public float DistanceTo(Point anotherPoint) { float dx = X - anotherPoint.X; float dy = Y - anotherPoint.Y; return (float)System.Math.Sqrt(dx * dx + dy * dy); }