Rays on a plane
Say I have two arbitrary rays, both of them have their own starting position and vector. How can I determine whether the two rays share a common plane?
[edit: typo]
[Edited by - eppo on June 16, 2008 7:15:23 AM]
If they share a common plane they will either be parallel or they will cross at some point.
So their vectors will either be linearly dependant (one of them can be expressed as the other multiplied by a scalar) or they will have at least one common point.
One way to get the intersection is to try and solve the intersection by restraining yourself to x and y coordinates ( wikipedia link ) and pluging the solution into the z coordiante to see if it matches.
So their vectors will either be linearly dependant (one of them can be expressed as the other multiplied by a scalar) or they will have at least one common point.
One way to get the intersection is to try and solve the intersection by restraining yourself to x and y coordinates ( wikipedia link ) and pluging the solution into the z coordiante to see if it matches.
Pick two points from each ray (the starting position and the starting position plus the vector will do) and check to see if those four points lie on the same plane.
|x1 y1 z1 1|
|x2 y2 z2 1| == 0
|x3 y3 z3 1|
|x4 y4 z4 1|
|x1 y1 z1 1|
|x2 y2 z2 1| == 0
|x3 y3 z3 1|
|x4 y4 z4 1|
The vector between their origins should be expressible by a linear combination of the ray direction vectors (i.e. all three should lie on the same plane). EDIT: Actually, it's that at least one of those vectors can be expressible by a linear combination of the other two. For instance, if both ray directions were parallel, then clearly you wouldn't be able to combine them to form the origin difference vector if it wasn't also parallel to the directions.
Be careful when determining coplanarity in 3D, however. Floating-point imprecision could lead you to believe that all three vectors don't lie on the same plane when in reality they do, or are so close that you might as well consider them coplanar.
[Edited by - Zipster on June 16, 2008 4:38:34 PM]
Be careful when determining coplanarity in 3D, however. Floating-point imprecision could lead you to believe that all three vectors don't lie on the same plane when in reality they do, or are so close that you might as well consider them coplanar.
[Edited by - Zipster on June 16, 2008 4:38:34 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement