Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / mouse pointer over or under a line?

Author
Message
shiny
20
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 16th Aug 2005 20:40 Edited at: 16th Aug 2005 23:33
lets say there is an arbitrary 2d line somwhere on the screen. How would I work out if the mouse pointer (or any point for that matter) is above or below that line? More specificly, I'm trying to work out which segment of the screen the mouse pointer is in - the screen is devided into 4 segments by two lines that cross in the middle of the screen. I know the liniar equation for each line, and the point at which they cross. See example attached.

Thankyou!

Attachments

Login to view attachments
shiny
20
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 17th Aug 2005 04:28
oh. no worries! i worked it out. It was as easy as finding the angle of each line, and the angle of the mouse pointer from the center, and then comparing then.

Thanks though.

MiR
20
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 17th Aug 2005 23:09
Quote: "It was as easy as finding the angle of each line, and the angle of the mouse pointer from the center, and then comparing then. "

Yes. Simple


Gimme teh votez!!!!

Login to post a reply

Server time is: 2024-04-26 04:50:17
Your offset time is: 2024-04-26 04:50:17