LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intersection point between plane and straight line in 3D space

Let's get one thing clear: A plane is defined by three points.  With four points, what you have is a plane and one point that may (or may not) be on the plane.  So the fourth point is superfluous at best, complicated and problematic at worst.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 16
(1,552 Views)

@Curr93 wrote:

Hello dear colleagues!

 

Excuse me ))) maybe someone found an example of finding the point of intersection of a plane and a straight line in 3D space? 

The plane is defined by 4 corner with known points (no equation), i.e. this is a kind of parallelepiped, and the line is defined by 2 points with known coordinates

 

I personally found the code for finding the intersection point of two straight lines in 2D space - thank you very much for it to MGI


You will end up needing to solve a system of 4 equations in 4 unknowns to get your point of interest.

 

The first equation, the equation of the plane in space, needs 3 points to describe it. I know you say you are more comfortable with 4 but the algorithm to find the equation only takes 3 points. If you really wanted, you could solve for the equation four times (once per combination of points) and do a check to see that they come out to be the same equation. But if they are truly on a flat plane, they should and it therefore won't matter which 3 points you used. This link and Tutorial 1 should give the direction you need to get that.

 

The other 3 equations come from solving the parametric representation of your line in 3-dimensional space. This link and Example 12.5.1 should help you with those.

 

Once you have your 4 equations, then what I would do is put them into standard matrix equation form AX B, then compute [x,y,z,t] = inverse(A)*B, and throw away the t value as it's unneeded in your case. Your point of interest will be the (x,y,z).

 

If you'd like to start making this sort of algorithm into a LabVIEW VI, I'm sure many of us would be willing to help if you get stuck.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 12 of 16
(1,546 Views)

Here is a simple example that takes a huge number of xyz point and does a second order 2D polynomial fit.

 

All you need to do is replace the stack of FOR loops with your four xyz data points and wire a 1 to the order input (default=2) where we create the H matrix. The rest should fall into place. (If you select order=1, you only get three terms, as expected.)

 

2DpolyFit.png

Message 13 of 16
(1,538 Views)

@billko wrote:

Let's get one thing clear: A plane is defined by three points.  


To complicate things, a plane can be defined by three points, but three points do not necessarily define a plane. If the points are on a line, they don't define a plane.

 

If you (OP) really wants to learn these kind of things, you'd have to dive deep into vector math. One great practical source for these kind of problems is 3D game programming. 3D Rendering, hit detection, ray tracing, etc. are all vector math...

0 Kudos
Message 14 of 16
(1,501 Views)

wiebe@CARYA wrote:

@billko wrote:

Let's get one thing clear: A plane is defined by three points.  


To complicate things, a plane can be defined by three points, but three points do not necessarily define a plane. If the points are on a line, they don't define a plane.

 

If you (OP) really wants to learn these kind of things, you'd have to dive deep into vector math. One great practical source for these kind of problems is 3D game programming. 3D Rendering, hit detection, ray tracing, etc. are all vector math...


LOL, thanks for reminding me.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 15 of 16
(1,486 Views)

 


@altenbach wrote earlier:

(lets assume that the four points are independent (e.g. not all four along one line in space, etc.), and that the plane is reasonable, e.g. not vertical or such)


😄

0 Kudos
Message 16 of 16
(1,479 Views)