+ 2
JAVA program on to find the mid-point of a line....
Guys, I need help on a program in which a function is to designed that is called by reference to find the mid-point of a line whose endpoints are given. Thanks in advance....
4 Answers
+ 3
Like something like this:
class point{int x,int y};
point mid-point(point endpoint1,point endpoint2)
{
point mid;
mid.x=(endpoint1.x+endpoint2.x)/2;
mid.y=(endpoint1.y+endpoint2.y)/2;
return mid;
}
+ 1
yes @matmozour thanks man
0
It won't be just point which coordinates will be arithmetic mean of endpoints coordinates?
0
start point + endpoint divided by 2.