Skip to main content
GameDev.net gamedev.net
🔒 Locked

point in rectangle

Started by mwilson May 3, 2000 at 11:27 AM 0 replies 550+ views
Original Post
mwilson
mwilson
Hi, I was just wondering how I''d go about finding out if a 2 point is inside a 2d rectangle cheers Mark
40 Thieves
40 Thieves


Rectangle (x1, y1, x2, y2);

userPoint = (x,y)

if (x>=x1 && x<=x2) {
if (y>=y1 && y<=y2) cout << "Point Is Inside rectangle";
}


www.databyss.com
www.omlettesoft.com

"Don''t meddle in the affairs of wizards, for they are subtle and quick to anger."
-40

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.