public bool IsWithinBounds(Vector2i from, Vector2i to) { return(this.x >= from.x && this.x < to.x && this.y >= from.y && this.y < to.y); }
// Scaling public void Scale(Vector2i scale) { x *= scale.x; y *= scale.y; }
public static float Magnitude(Vector2i a) { return(a.magnitude); }
public static float SqrMagnitude(Vector2i a) { return(a.sqrMagnitude); }
public static int Dot(Vector2i lhs, Vector2i rhs) { return(lhs.x * rhs.x + lhs.y * rhs.y); }
public static int manhattanDistance(Vector2i a, Vector2i b) { return(Math.Abs(a.x - b.x) + Math.Abs(a.y - b.y)); }
// Static methods public static float Distance(Vector2i a, Vector2i b) { return((a - b).magnitude); }
public bool Equals(Vector2i other) { return(this == other); }
public static Vector2i RotateCCW(Vector2i a) { return(new Vector2i(-a.y, a.x)); }