#### Archived

This topic is now archived and is closed to further replies.

# Distane of point to plane

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

## Recommended Posts

I want to find the distance from a plane to an arbitrary point. Ive googled this and found hundreds of pages of answers, but all of them were for the ax + by + cz + d = 0 form of a plane. I use the point-normal form of planes. So how can I do it?

##### Share on other sites
I might be a little off,

but if 'n' is your normal -> (n1, n2, n3)

then Cartesion form of your plane would be
(of the form Ax + By + Cz + D = 0 ):

n1*x + n2*y + n3*z - D = 0

from that you should be able to calculate your distance from an arbitrary point to your plane.

( i think )

please, anyone feel free to correct me. heh

[edited by - _vizual_ on January 14, 2004 1:16:13 AM]

##### Share on other sites
not quite viz
Distance=dot(Point,Plane.Normal)-dot(Plane.Normal,Plane.Point)

but really rather then storing a point on the plane you should store precomputed "dot(Plane.Normal,Plane.Point)" sence thats alot of extra to do, and thats what people normaly do and if you need better way to think of it, it''s the distance from the origin to the plane

##### Share on other sites
Just use Hessian normal form of a plane

distance = dot([unit normal],x0) + p.

x0 is your arbitrary point (x,y,z)

(look up Hessian form and you'll see 'p')

JHL,

I fail to see where the method I stated was incorrect. It's one way of doing it. Ofcourse there is much more involved after that as well. I don't recall your forumlae but it certainly looks more elegant if thats is all.

[edited by - _vizual_ on January 14, 2004 2:25:06 AM]

##### Share on other sites
>Distance=dot(Point,Plane.Normal)-dot(Plane.Normal,Plane.Point)

id prefer dot(Plane.Normal, Point-Plane.Point) though ,-)

##### Share on other sites
To find the distance a point is from a plane:

distance = AX + BY + CZ + D

Where ABC is the normal of the plane, XYZ is the point you're testing, and D is the plane-shift distance from the origin. This can also be expressed as:

distance = N.P + D

If the distance is 0 then the point lies on the plane, if the distance is greater than 0 then the point lies on the front side of the plane (the front of a plane is defined by its normal's direction), and finally, if the distance is less then 0 then the point lies on the back side of the plane.

EDIT: Trienco, thanks for pointing that out.

[edited by - Chacha on January 16, 2004 6:30:52 AM]

##### Share on other sites
quote:
Original post by Chacha
To find the distance a point is from a plane:

distance = AX + BY + CZ + D

Where ABC is the normal of the plane, XYZ defines any point located on the plane, and D is the plane-shift distance from the origin.

call me blind, but to find the distance between a point and a plane, shouldnt the point show up somewhere in the equation?

also, calculating D would probably be done as XYZ.N, while in the function above xyz should rather be point itself. so we end up with N.P - N.V (V being a point on the plane) which should be slightly less work as N.(P-V). basically you just get a vector from anywhere on the plane and project it on the planes normal (which will mean how many times the normal vector is the point from the plane.. as the normal is unit length its also the distance)

[edited by - Trienco on January 15, 2004 3:49:04 AM]

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 13
• 14
• 9
• ### Forum Statistics

• Total Topics
633365
• Total Posts
3011522
• ### Who's Online (See full list)

There are no registered users currently online

×