adspace
Answer Posted / Roushan Kumar Tiwary
To calculate the distance between two points (x1, y1) and (x2, y2) in Java, you can use the Pythagorean theorem:nn```javandouble x1 = ...;ndouble y1 = ...;ndouble x2 = ...;ndouble y2 = ...;ndouble distance = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is latest hibernate version?
What is the difference between equals() and == in java?
What are the differences between heap and stack memory in java?
What is java string pool?
What do you mean by an interface in java?
Can we return resultset in java?
Write a program to find the whether a number is an Armstrong number or not?
What is difference between @controller and @restcontroller in spring?
explain different ways of using thread? : Java thread
i want test pattern of zylog company and some examples also
How is declarative handling of exceptions done in struts ?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
How to sort array in descending order in java?
Find Best Job Vacancies across the world on Jooble!
Is minecraft 1.15 out?