# intersecting lines

This topic is 3650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Simple question: line AB intersects line CD at point P. solve P. [Edited by - Dauid on January 22, 2009 2:14:24 PM]

##### Share on other sites
Well,

AB : ax + by = c ( basic math, this is the ecuation of a line )
CD : dx + ey = f

then you just make a system of the two ecuations and the resulting x's and y's are the coordonates of P

*later edit*

let's presume line AB is defined as : 3x + 2y = 1
CD is defined as : 2x + y = 0

{ 2y = 1 - 3x | *(-2)
{ y = - 2x | *3

{ -4y = -2 + 6x
{ 3y = -6x
----------------
-y = -2 => |y = 2|

and now for the x

4 = 1 - 3x
-3x = 3
|x = -1;|

so there you go, the point of intersection between these two lines is P ( -1, 2 )
*/later edit*

Hope I made some sense :P

##### Share on other sites
Quote:
 Original post by DauidSimple question:line AB intersects line CD at point P.define P.

You just did... P is the point where line AB intersects line CD. Perhaps you didn't mean "define", but something else?

##### Share on other sites
hm, I should have mentioned I was trying to avoid the lineequation.

consider this example, you have a 4-sided polygon,
assign the diagonals to the polygon and solve where the diagonals intersect.

##### Share on other sites
But you must have some sorts of coordinates for the points of the lines ?

In which case you can use the (y = mx+b) formula to find out the ecuation and move forward.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634111
• Total Posts
3015564
×