예제 #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;
 }
예제 #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();
     }
 }
예제 #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;
     }
 }
예제 #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;
     }
 }
예제 #5
0
 public void translate(double _x, double _y, FVector2D n)
 {
     n.x = x + _x;
     n.y = y + _y;
 }
예제 #6
0
 public void scale(double scalar, FVector2D n)
 {
     n.x = x*scalar;
     n.y = y * scalar;
 }
예제 #7
0
 public double getAngleFrom(FVector2D v)
 {
     return Math.Atan2(this.y-v.y, this.x-v.x);
 }