public IVector2D Multiply(float scalar) { IVector2D r = new Vector2D(X * scalar, Y * scalar); return r; }
public IVector2D Negate() { IVector2D r = new Vector2D(-X, -Y); return r; }
public IVector2D Divide(float divisor) { IVector2D r = new Vector2D(X / divisor, Y / divisor); return r; }
public IVector2D Add(IVector2D v) { IVector2D r = new Vector2D(X + v.X, Y + v.Y); return r; }
public IVector2D Substract(IVector2D v) { IVector2D r = new Vector2D(X - v.X, Y - v.Y); return r; }
public IVector2D Rotate90() { IVector2D r = new Vector2D(-Y, X); return r; }
public IVector2D Rotate(float degrees) { float radians = degrees.ToRadians(); var sine = (float)Math.Sin(radians); var cosine = (float)Math.Cos(radians); IVector2D r = new Vector2D(X * cosine - Y * sine, X * sine - Y * cosine); return r; }