Question: JAVA Write a method that calculates and returns the distance between two points. The method takes four double parameters: x1, y1, x2, y2 and returns
JAVA
Write a method that calculates and returns the distance between two points. The method takes four double parameters: x1, y1, x2, y2 and returns the distance between the two points calculated using the below formula. The method header is as follows: public static double distance (double x1, double y1, double x2, double y2)
DISTANCE = RADICAL (( X2-X1)2+ (Y2-Y1)2)
b- Write a program that allows the user to enter coordinates of circle center and radius then asks for the coordination of each point to check if it is inside the circle or not. (point is inside the circle if the distance between point and center is less than or equal to radius).
ENTER X AND YCOORDINATES OF CENTER AND RADUIS: 0 0 8
ENTER X AND Y COORDINATES OF THE POINT :2 4
POINT IS INSIDE CIRCLE\
CHECKS ANOTHER POINT? Y
ENTER X AND Y COORDINATES OF :7 12
POINT IS OUTSIDE CIRCLE
CHECK ANOTHER POINT ?N
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
