public void rotate(double angle, FVector2D n) { double newX = x*Math.Cos(angle) - y*Math.Sin(angle); double newY = y * Math.Cos(angle) + x * Math.Sin(angle); n.x = newX; n.y = newY; }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { FVector2D vector = new FVector2D(0, 1); using (FManager game = new FManager()) { game.Run(); } }
public void subtract(FVector2D v, FVector2D n) { if (v != null && n != null) { n.x = this.x - v.x; n.y = this.y - v.y; } }
public void add(FVector2D v, FVector2D n) { if (v != null && n != null) { n.x = v.x + this.x; n.y = v.y + this.y; } }
public void translate(double _x, double _y, FVector2D n) { n.x = x + _x; n.y = y + _y; }
public void scale(double scalar, FVector2D n) { n.x = x*scalar; n.y = y * scalar; }
public double getAngleFrom(FVector2D v) { return Math.Atan2(this.y-v.y, this.x-v.x); }