Question: If x 1 , y 1 , x 2 , and y 2 are respectively the coordinates of two points, what is the correct java

If x1,y1,x2, and y2 are respectively the coordinates of two points, what is the correct java code to calculate and display the distance between these two points using the Distance Formula?
Distance formula
d=(x2-x1)2+(y2-y1)22
d,= distance
(x1,y1)= coordinates of the first point
(x2,y2)= coordinates of the second point
Math.sqrt(Math.pow(2,x2-x1), Math.pow(2,y2-y1))
Math.sqrt(Math.pow(x2+x1,Math.pow(y2+y1))
Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2))
Math.pow(Math.sqrt (x2-x1,2)+ Math.sqrt (y2-y1,2))
None of the other answers
 If x1,y1,x2, and y2 are respectively the coordinates of two points,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!