/// <summary>
 /// Calculate de distance to the other point 
 /// </summary>
 /// <param name="other">other point 2d</param>
 /// <returns>distance by pitagoras</returns>
 public double DistanceTo(Point2D other)
 {
     var x = _x - other.X;
     var y = _y - other.Y;
     return (Math.Sqrt(x*x+y*y)); //Math.Sqrt it's the same as make ¿square root?
 }
 /// <summary>
 /// constructor with other point
 /// </summary>
 /// <param name="other">other point2D</param>
 public Point2D(Point2D other)
 {
     _x = other.X;
     _y = other.Y;
 }
Beispiel #3
0
 /// <summary>
 /// constructor with other point
 /// </summary>
 /// <param name="other">other point2D</param>
 public Point2D(Point2D other)
 {
     _x = other.X;
     _y = other.Y;
 }