Check whether a given point lies on or inside the rectangle | Set 3 | function to Check whether a given point lies inside or on the rectangle or not ; Driver code
function LiesInsieRectangle ( a , b , x , y ) { if ( x - y - b <= 0 && x - y + b >= 0 && x + y - 2 * a + b <= 0 && x + y - b >= 0 ) return true ; return false ; } let a = 7 , b = 2 , x = 4 , y = 5 ; if ( LiesInsieRectangle ( a , b , x , y ) ) document . write ( " " ) ; else document . write ( " " ) ;