# Simple answer for intersecting lines?

• 05-31-2008
LLINE
I am scratching my head trying to figure out how to display a XY pixel value for 2 intersecting lines.

I am working on a 2d graphical application that deals with lines or slopes.

> Both lines always intersect

> I have line "CD" which pixel values are known for both C and D

> I know the pixel location of A

> the application is dynamic in that I can grab point B and move it vertically (assuming that CD is somewhat horizontal)

> I am attempting to display the pixel values in which AB and CD intersect

Can anybody lead me in the right direction? I appreciate your help!
• 05-31-2008
Dino
This post is very vague.

Do you need help with the formula to find the intersection point of two lines?
Or, do you need help with the code to display a pixel?
And, what platform and what GUI?
And the really big question is... why does you head itch?

Todd
• 05-31-2008
Magos
Searching on this brings up this
• 05-31-2008
VirtualAce
Usually to see if two lines are intersecting you would set them equal to one another and solve.
• 05-31-2008
LLINE
Quote:

Originally Posted by Todd Burch
This post is very vague.

Do you need help with the formula to find the intersection point of two lines?
Or, do you need help with the code to display a pixel?
And, what platform and what GUI?
And the really big question is... why does you head itch?

Todd

Just need help with the equation. - My head itches b/c I have no idea what I am doing :>)
• 05-31-2008
Dino
See here for a good explanation:

http://id.mind.net/~zona/mmts/inters...TwoLines1.html

And here for sample source code:

http://local.wasp.uwa.edu.au/~pbourk...ry/lineline2d/

Todd
• 06-01-2008
LLINE
Thanks Todd and everyone else!!!