Write a class Point for 2D Cartesian co-ordinates. The class should have 2 fields: abscissa(x) and ordinately). The class should have a method which takes a Point object as parameter and finds the...


Write a class Point for 2D Cartesian co-ordinates. The class should have 2 fields: abscissa(x) and<br>ordinately). The class should have a method which takes a Point object as parameter and finds the<br>distance between the two points (calling object & argument). The class should also have a static method<br>that takes 2 point objects and returns their midpoint as a new Point object. (No driver class or no other<br>methods required)<br>The distance (d) between 2 points (x1, y1) and (x2, y2) is given by:<br>d = (x1 – x2)2 + (y1 – y2)²<br>The midpoint (x3, y3) between 2 points (x1, y1) and (x2, y2) is given by:<br>x3 = (x1+x2)/2<br>y3 = (y1+y2)/2<br>

Extracted text: Write a class Point for 2D Cartesian co-ordinates. The class should have 2 fields: abscissa(x) and ordinately). The class should have a method which takes a Point object as parameter and finds the distance between the two points (calling object & argument). The class should also have a static method that takes 2 point objects and returns their midpoint as a new Point object. (No driver class or no other methods required) The distance (d) between 2 points (x1, y1) and (x2, y2) is given by: d = (x1 – x2)2 + (y1 – y2)² The midpoint (x3, y3) between 2 points (x1, y1) and (x2, y2) is given by: x3 = (x1+x2)/2 y3 = (y1+y2)/2

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here