Check if a point lies inside a rectangle | Set | function to find if given point lies inside a given rectangle or not . ; bottom - left and top - right corners of rectangle ; given point ; function call
function FindPoint ( x1 , y1 , x2 , y2 , x , y ) { if ( x > x1 && x < x2 && y > y1 && y < y2 ) return true ; return false ; } let x1 = 0 , y1 = 0 , x2 = 10 , y2 = 8 ; let x = 1 , y = 5 ; if ( FindPoint ( x1 , y1 , x2 , y2 , x , y ) ) document . write ( " " ) ; else document . write ( " " ) ;