Program to calculate distance between two points | Function to calculate distance ; Calculating distance ; Drivers Code
function distance ( x1 , y1 , x2 , y2 ) { return Math . sqrt ( Math . pow ( x2 - x1 , 2 ) + Math . pow ( y2 - y1 , 2 ) * 1.0 ) ; } document . write ( distance ( 3 , 4 , 4 , 3 ) ) ;