Write a method called distance that accepts four integer coordinates x 1 , y 1 , x

Question:

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

d = (x2 – 21)² + (y2 – Y1)?

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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: