Perpendicular distance between a point and a Line in 2 D | Function to find distance ; Driver code
function shortest_distance ( x1 , y1 , a , b , c ) { var d = Math . abs ( ( ( a * x1 + b * y1 + c ) ) / ( Math . sqrt ( a * a + b * b ) ) ) ; document . write ( " " + " " + d . toFixed ( 11 ) ) ; return ; } var x1 = 5 ; var y1 = 6 ; var a = - 2 ; var b = 3 ; var c = 4 ; shortest_distance ( x1 , y1 , a , b , c ) ;