@Override public Vector4i toInt() { return new Vector4i(x, y, z, w); }
public static Vector4i from(int x, int y, int z, int w) { return x == 0 && y == 0 && z == 0 && w == 0 ? ZERO : new Vector4i(x, y, z, w); } }
@Override public Vector4i clone() { return new Vector4i(this); }
@Override public Vector4i negate() { return new Vector4i(-x, -y, -z, -w); }
@Override public Vector4i toInt() { return new Vector4i(x, y, z, w); }
@Override public Vector4i negate() { return new Vector4i(-x, -y, -z, -w); }
@Override public Vector4i toInt() { return new Vector4i(x, y, z, w); }
@Override public Vector4i clone() { return new Vector4i(this); }
public Vector4i div(int x, int y, int z, int w) { return new Vector4i(this.x / x, this.y / y, this.z / z, this.w / w); }
public static Vector4i from(int n) { return n == 0 ? ZERO : new Vector4i(n, n, n, n); }
public Vector4i add(int x, int y, int z, int w) { return new Vector4i(this.x + x, this.y + y, this.z + z, this.w + w); }
public Vector4i mul(int x, int y, int z, int w) { return new Vector4i(this.x * x, this.y * y, this.z * z, this.w * w); }
@Override public Vector4i toInt() { return new Vector4i(x, y, z, w); }
@Override public Vector4i pow(int power) { return new Vector4i(Math.pow(x, power), Math.pow(y, power), Math.pow(z, power), Math.pow(w, power)); }
@Override public Vector4i abs() { return new Vector4i(Math.abs(x), Math.abs(y), Math.abs(z), Math.abs(w)); }
public Vector4i min(int x, int y, int z, int w) { return new Vector4i(Math.min(this.x, x), Math.min(this.y, y), Math.min(this.z, z), Math.min(this.w, w)); }
public static Vector4i deserialize4i(JsonElement element) { return new Vector4i( element.getAsJsonObject().get("x").getAsInt(), element.getAsJsonObject().get("y").getAsInt(), element.getAsJsonObject().get("z").getAsInt(), element.getAsJsonObject().get("w").getAsInt() ); }
public static Vector4i deserialize4i(JsonElement element) { return new Vector4i( element.getAsJsonObject().get("x").getAsInt(), element.getAsJsonObject().get("y").getAsInt(), element.getAsJsonObject().get("z").getAsInt(), element.getAsJsonObject().get("w").getAsInt() ); }
public Vector4i project(int x, int y, int z, int w) { final int lengthSquared = x * x + y * y + z * z + w * w; if (lengthSquared == 0) { throw new ArithmeticException("Cannot project onto the zero vector"); } final float a = (float) dot(x, y, z, w) / lengthSquared; return new Vector4i(a * x, a * y, a * z, a * w); }
public Vector4i project(int x, int y, int z, int w) { final int lengthSquared = x * x + y * y + z * z + w * w; if (lengthSquared == 0) { throw new ArithmeticException("Cannot project onto the zero vector"); } final float a = (float) dot(x, y, z, w) / lengthSquared; return new Vector4i(a * x, a * y, a * z, a * w); }