public Vector2d(Point2d a, Point2d b)
 {
     base.X = a.X - b.X;
     base.Y = a.Y - b.Y;
 }
 public static Vector2d Subtract(Point2d a, Point2d b)
 {
     return(new Vector2d(a.X - b.X, a.Y - b.Y));
 }
 public static Vector2d Add(Point2d a, Point2d b)
 {
     return(new Vector2d(a.X + b.X, a.Y + b.Y));
 }
 public static double DotProduct(Point2d b, Vector2d a)
 {
     return(a.X * b.X + a.Y * b.Y);
 }
Example #5
0
 public static bool IsEqual(Point2d a, Point2d b)
 {
     return(Point2d.Distance(a, b) <= Utility.Domain);
 }
Example #6
0
 public static double Distance(Point2d a, Point2d b)
 {
     return(Utility.Round(Math.Sqrt(Math.Pow((a.X - b.X), 2) + Math.Pow((a.Y - b.Y), 2))));
 }
Example #7
0
 public double DistanceTo(Point2d b)
 {
     return(Point2d.Distance(this, b));
 }
Example #8
0
 public Point2d(Point2d otherPoint)
 {
     X = otherPoint.X;
     Y = otherPoint.Y;
 }