Check whether the point ( x , y ) lies on a given line | Function that return true if the given point lies on the given line ; If ( x , y ) satisfies the equation of the line ; Driver code
function pointIsOnLine ( m , c , x , y ) { if ( y == ( ( m * x ) + c ) ) return true ; return false ; } var m = 3 , c = 2 ; var x = 1 , y = 5 ; if ( pointIsOnLine ( m , c , x , y ) ) document . write ( " " ) ; else document . write ( " " ) ;