This commit is contained in:
didier amyot committed 2023-08-15 10:19:37 -04:00
1 parent e8ccd877a0
commit a6b2f6677f
3 files changed
+46 -1

No files matched your search

+11
View File
@@ -11,6 +11,10 @@ class Point
this.y = y;
}
public Point(){
Point(0, 0);
}
public double X()
{
return x;
@@ -26,4 +30,11 @@ class Point
return Math.Sqrt(X() * X() + Y() * Y());
}
public Point MidPointOf(Point other)
{
double midX = (X() + other.X()) / 2;
double midY = (Y() + other.Y()) / 2;
return new Point(midX, midY);
}
}