cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Fitting a plane to 3 points

Jbryant61
4-Participant

Fitting a plane to 3 points

Can anyone help with this worksheet please. I've setup 3 simultaneous equations but am struggling to solve them.

How to draw the points in 3D and the plane also??

Thanks

Jason

ACCEPTED SOLUTION

Accepted Solutions

Try the attached.

Alan

View solution in original post

13 REPLIES 13

May by so:

abc.png

Hi,, thanks. What happened to "d". And how would I then plot this plane as well as the 3 points on it?

Thanks

Jason

Two of the points are identical (nbrs 2 and 3) so there are an infinite number of planes that could go through them!

You get rid of d by dividing through by your original coefficient of z.

Alan

Jbryant61
4-Participant
(To:AlanStevens)

ahh. sorry thats a typo. point 3 shoud be (x,y,z = 1,1,3), its not real data its just to eb able to setup a matlab sheet to then deal with real data.

Try the attached.

Alan

Jbryant61
4-Participant
(To:AlanStevens)

Thankyou Alan.

Jbryant61
4-Participant
(To:AlanStevens)

I thought I had this worked out. For some reason, when I change the 3 data points (to real data), the plane doesn't cover the points but seems to start at the origin. It seems the "QuickPlot Data" is turned on. i can't see how to bypass this automatically.

also, when I want to add a genral point using the plane to calculate the Z for a given X,Y, I don't quite seem to be able to draw that point. its drawing 3 points for some reason.

Thanks

Jason

Werner_E
25-Diamond I
(To:Jbryant61)

Jason Bryant wrote:

I thought I had this worked out. For some reason, when I change the 3 data points (to real data), the plane doesn't cover the points but seems to start at the origin. It seems the "QuickPlot Data" is turned on. i can't see how to bypass this automatically.

bypass? Telling from the sheet you attached it seems you found out yourself how to fix this problem by simply setting the range for x and y in the Quickplot tab. Its annoying that we cannot use variables there. You may consider using CreateMesh() to automate it. Calculate the minimum and maximum values for x and y depending on the coordinates of all points used and feed those values as limits in Createmesh() to create a data structure which will plot your plane.

also, when I want to add a genral point using the plane to calculate the Z for a given X,Y, I don't quite seem to be able to draw that point. its drawing 3 points for some reason.

If you look at the sheet I posted earlier you find the solution. The elements of the vector representing the point must be 1x1 matrices, not scalars.

19.05.png

Jbryant61
4-Participant
(To:Werner_E)

Perfect, thankyou. Why is it you can't just plot a point using scalars?

Werner_E
25-Diamond I
(To:Jbryant61)

Why is it you can't just plot a point using scalars?

Because its implemented that way 😉

There is a logic here. To plot a couple of points you have to provide a 3-element vector consisting of three vectors representing the the x-, y- and z-coordinates of those points. To plot a single those vectors consist of just 1 element each. So Mathcad's 3D plot needs three vectors packed into one single outer vector to plot points. If you provide less than three vectors, Mathcad adds the missing ones itself. You provided just one vector and Mathcad would automatically interprete this as the z-coordinates of points - so you got three points instead of the one you expected. The x-coordinates are added as (0,1,2) and the y-coordinates as all zero, So you saw the points (0/0/X), (1/0/Y) and (2/0/Z).

While there is a logic in that behaviour its nonetheless cumbersome and if you need it more than once you might consider creating a small function to do the conversion:

19.05.png

or for a list of points

19.05.png

AlanStevens wrote:

Two of the points are identical (nbrs 2 and 3) so there are an infinite number of planes that could go through them!

Yes. here better use not Find but lsolve function:

abc1.png

Werner_E
25-Diamond I
(To:Jbryant61)

I guess the attached file should help.

16.05.png

Jbryant61
4-Participant
(To:Werner_E)

Thankyou. I love your graphic!

Announcements

Top Tags