Skip to main content

Write a function to calculate distance between three points

 Distance between two points (x1, y1) and (x2, y2) is calculated as:

                 


Java

In java, to round double values to 2 decimal places, we use round() 
   
double val = 3.1624537484;

Math.round ( val * 100.0 / 100.0 )       ====> It produces 3.16

Write a function to calculate distance between three points java

Python

In python, to round values, we use round().

Write a function to calculate distance between three points python