@Override public Vector2l negate() { return new Vector2l(-x, -y); }
@Override public Vector2l toLong() { return new Vector2l(x, y); }
@Override public Vector2l toLong() { return new Vector2l(x, y); }
@Override public Vector2l clone() { return new Vector2l(this); }
public static Vector2l from(long n) { return n == 0 ? ZERO : new Vector2l(n, n); }
@Override public Vector2l toLong() { return new Vector2l(x, y); }
@Override public Vector2l negate() { return new Vector2l(-x, -y); }
public Vector2l toVector2() { return new Vector2l(this); }
public Vector2l mul(long x, long y) { return new Vector2l(this.x * x, this.y * y); }
@Override public Vector2l toLong() { return new Vector2l(x, y); }
@Override public Vector2l toLong() { return new Vector2l(x, y); }
@Override public Vector2l toLong() { return new Vector2l(x, y); }
public Vector2l max(long x, long y) { return new Vector2l(Math.max(this.x, x), Math.max(this.y, y)); }
public Vector2l max(long x, long y) { return new Vector2l(Math.max(this.x, x), Math.max(this.y, y)); }
@Override public Vector2l pow(long power) { return new Vector2l(Math.pow(x, power), Math.pow(y, power)); }
@Override public Vector2l abs() { return new Vector2l(Math.abs(x), Math.abs(y)); }
public static Vector2l deserialize2l(JsonElement element) { return new Vector2l( element.getAsJsonObject().get("x").getAsLong(), element.getAsJsonObject().get("y").getAsLong() ); }
public static Vector2l deserialize2l(JsonElement element) { return new Vector2l( element.getAsJsonObject().get("x").getAsLong(), element.getAsJsonObject().get("y").getAsLong() ); }
public Vector2l project(long x, long y) { final long lengthSquared = x * x + y * y; if (lengthSquared == 0) { throw new ArithmeticException("Cannot project onto the zero vector"); } final double a = (double) dot(x, y) / lengthSquared; return new Vector2l(a * x, a * y); }
public Vector2l project(long x, long y) { final long lengthSquared = x * x + y * y; if (lengthSquared == 0) { throw new ArithmeticException("Cannot project onto the zero vector"); } final double a = (double) dot(x, y) / lengthSquared; return new Vector2l(a * x, a * y); }