Why Aren't My Parametric Lines Intersecting?

  • Context: Undergrad 
  • Thread starter Thread starter Pazil
  • Start date Start date
  • Tags Tags
    Line Parametric
Click For Summary
SUMMARY

The discussion centers on the challenges of intersecting parametric lines using the equations x = x1 + t(x2 - x1) and y = y1 + t(y2 - y1). The user initially attempted to calculate the intersection by using a single parameter "t" for both lines, which led to incorrect results. A key insight shared is that different parameters should be used for each line, denoted as "t" and "s", to accurately solve for the intersection point. The user also referenced a resource for a complete equation to find the "t" variable for the first line, enhancing their understanding of the topic.

PREREQUISITES
  • Understanding of parametric equations
  • Familiarity with algebraic manipulation of equations
  • Basic knowledge of geometry, particularly line intersections
  • Experience with programming concepts related to mathematical computations
NEXT STEPS
  • Study the derivation of parametric line equations in detail
  • Learn how to solve systems of equations involving multiple parameters
  • Explore geometric interpretations of line intersections in 2D space
  • Investigate computational geometry algorithms for line intersection
USEFUL FOR

Mathematicians, computer graphics developers, and anyone involved in computational geometry or programming simulations that require accurate line intersection calculations.

Pazil
Messages
8
Reaction score
0
Hello!

I'm having a pretty big problem intersecting parametric lines. I'm using the equations:
x = x1 + t(x2 - x1)
y = y1 + t(y2 - y1)

Given the 2 lines:
x = x1 + t(x2 - x1)
y = y1 + t(y2 - y1)

x = x3 + t(x4 - x3)
y = y3 + t(y4 - y3)

I calculate the intersection, using this:
t = ( x3 - x1 ) / ( (x2 - x1) - (x4 - x3) )

And then I would plug it into the first line...

For some odd reason...it doesn't work! And the funny thing is, that it used to work in my program. I'm not sure if I made any changes, but it's really screwing things up...

Please help!

P.
 
Physics news on Phys.org
Why would you think that would work? There is no reason to thing that the same value of the parameter in each line gives the point of intersection. Think of "t" as representing the time some object is at each point on the line. The same t giving the point of interesection would be equivalent to the two objects being at that point at the same time which is not necessary for a point of intersection. To make it clear that the parameters in the two different lines are not necessarily the same, use different letters, say t and s:
x = x1 + t(x2 - x1)
y = y1 + t(y2 - y1)
and
x = x3 + s(x4 - x3)
y = y3 + s(y4 - y3)

set x and y equal:
x1+ t(x2-x1)= x3+ s(x4- x3) and y1+ t(y2-y1)= y3+ s(y4-y3)
and you have two equations to solve for the two parameters s and t.
 
ARRRG!

I was wondering why it worked before! In my first tests I had used lines of equal length and intersecting in the middle!
I now understand. I knew that you of course couldn't plug "t" into any of the two...I thought it depended to which equation you plugged it into.
Anywho, I found a complete equation finding the "t" variable for the first line:
http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/

Thanks for your help and explaining anyhow! The more math stuff I start getting through my head, the more I'll be able to learn on my own!

P.
 
Last edited by a moderator:

Similar threads

Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
17
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K