Point2D.cs 565 B

123456789101112131415161718192021222324
  1. namespace Masuit.Tools.Maths
  2. {
  3. public class Point2D
  4. {
  5. public double X { get; set; }
  6. public double Y { get; set; }
  7. public Point2D(double x, double y)
  8. {
  9. X = x;
  10. Y = y;
  11. }
  12. public static Vector2D operator -(Point2D first, Point2D second)
  13. {
  14. return new Vector2D(first.X - second.X, first.Y - second.Y);
  15. }
  16. public static Point2D operator +(Point2D pt, Vector2D vec)
  17. {
  18. return new Point2D(pt.X + vec.X, pt.Y + vec.Y);
  19. }
  20. }
  21. }