Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 /// <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();
     }
 }
Exemplo n.º 3
0
 public void subtract(FVector2D v, FVector2D n)
 {
     if (v != null && n != null)
     {
         n.x = this.x - v.x;
         n.y = this.y - v.y;
     }
 }
Exemplo n.º 4
0
 public void add(FVector2D v, FVector2D n)
 {
     if (v != null && n != null)
     {
         n.x = v.x + this.x;
         n.y = v.y + this.y;
     }
 }
Exemplo n.º 5
0
 public void translate(double _x, double _y, FVector2D n)
 {
     n.x = x + _x;
     n.y = y + _y;
 }
Exemplo n.º 6
0
 public void scale(double scalar, FVector2D n)
 {
     n.x = x*scalar;
     n.y = y * scalar;
 }
Exemplo n.º 7
0
 public double getAngleFrom(FVector2D v)
 {
     return Math.Atan2(this.y-v.y, this.x-v.x);
 }