Check if it is possible to draw a straight line with the given direction cosines | Function that returns true if a straight line is possible ; Driver code
function isPossible ( x , y , z ) { let a = Math . round ( x * x + y * y + z * z ) ; if ( Math . ceil ( a ) == 1 && Math . floor ( a ) == 1 ) return true ; return false ; } let l = 0.70710678 , m = 0.5 , n = 0.5 ; if ( isPossible ( l , m , n ) ) document . write ( " " ) ; else document . write ( " " ) ;