example
This commit is contained in:
1 parent
e8ccd877a0
commit
a6b2f6677f
3 files changed
+46
-1
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user