public float computeLength() { return FMath.sqrt(x * x + y * y); }
public float manhattan(Vector2 v) { return FMath.abs(x - v.x) + FMath.abs(y - v.y); }
public float normalize_ip() { float l = FMath.sqrt(x * x + y * y); x /= l; y /= l; return l; }
public float distance(Vector2 v) { return FMath.sqrt((x - v.x) * (x - v.x) + (y - v.y) * (y - v.y)); }
public void setFromAngle(float a) { x = FMath.cos(a); y = FMath.sin(a); }