Question: Write a method called distance that accepts four integer coordinates x 1 , y 1 , x 2 and y 2 as parameters and computes
Write a method called distance that accepts four integer coordinates x1, y1, x2 and y2 as parameters and computes the distance between points (x1, y1) and (x2, y2) on the Cartesian plane. The equation for the distance is

For example, the call of distance(1, 0, 4, 4) would return 5.0 and the call of distance(10, 2, 3, 15) would return 14.7648230602334.
d = (x2 21) + (y2 Y1)?
Step by Step Solution
3.36 Rating (171 Votes )
There are 3 Steps involved in it
public static double distance int x1 int yl int x... View full answer
Get step-by-step solutions from verified subject matter experts
