Program to find line passing through 2 Points | Function to find the line given two points ; Driver code
function lineFromPoints ( P , Q ) { var a = Q [ 1 ] - P [ 1 ] var b = P [ 0 ] - Q [ 0 ] var c = a * ( P [ 0 ] ) + b * ( P [ 1 ] ) if ( b < 0 ) document . write ( " " + " " + a + " " + b + " " + c + " " ) else document . write ( " " + " " + a + " " + b + " " + c + " " ) } var P = [ 3 , 2 ] var Q = [ 2 , 6 ] lineFromPoints ( P , Q )