Is an XY point inside a rectangle

suggest change

Tests if an [x,y] point is inside a rectangle.

// rectangle objects: {x:, y:, width:, height: }
// var rect={x:10, y:15, width:25, height:20}
// Return true if the x,y point is inside the rectangle

function isPointInRectangle(x,y,rect){
    return(x>rect.x && x<rect.x+rect.width && y>rect.y && y<rect.y+rect.height);
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents