Пример #1
0
 public Vector2F(Location2F coords)
 {
     X            = coords.X;
     Y            = coords.Y;
     lengthFound  = false;
     radiansFound = false;
 }
Пример #2
0
 /// <summary>
 /// Creates a new Vector from locA to locB
 /// </summary>
 /// <param name="locA">Start location</param>
 /// <param name="locB">End location</param>
 public Vector2F(Location2F locA, Location2F locB)
 {
     X            = locB.X - locA.X;
     Y            = locB.Y - locA.Y;
     lengthFound  = false;
     radiansFound = false;
 }
Пример #3
0
 public Location2F Midpoint(Location2F loc)
 {
     return(new Location2F((loc.X + X) / 2, (loc.Y + Y) / 2));
 }
Пример #4
0
 public float DistanceTo(Location2F loc)
 {
     return((float)Math.Sqrt(DistanceToSquared(loc)));
 }
Пример #5
0
 public float DistanceToSquared(Location2F loc)
 {
     return((float)Math.Pow(loc.X - X, 2) + (float)Math.Pow(loc.Y - Y, 2));
 }
Пример #6
0
 public Location2F(Location2F loc)
 {
     X = loc.X;
     Y = loc.Y;
 }