Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Point averagePoint(Point points[], int length){
- double resultX;
- double resultY;
- double x;
- double y;
- for(int i=0; i <= length; i++){
- resultX+=points[i].getX;
- resultY+=points[i].getY;
- }
- x = resultX/length;
- y = resultY/length;
- Point middlePoint(x,y);
- return middlePoint;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement