Sign in to follow this  
TimChan

Find the normal of a plane, given D and x,y and z[SOLVED]

Recommended Posts

TimChan    109
Hi, i'm confused about finding the normal of a plane, which formed by a point(x, y, z) and the distance between the origin and that plane. By the equation, Ax + By + Cz + D = 0, we can find out the distance(D), but how can we compute the normal's components(A, B and C)? i've searched a post and found the solution: A = y1 ( z2 - z3 ) + y2 ( z3 - z1 ) + y3 ( z1 - z2 ) B = z1 ( x2 - x3 ) + z2 ( x3 - x1 ) + z3 ( x1 - x2 ) C= x1 ( y2 - y3 ) + x2 ( y3 - y1 ) + x3 ( y1 - y2 ) D = - x1 ( y2z3 - y3z2 ) - x2 ( y3z1 - y1z3 ) - x3 ( y1z2 - y2z1 ) What do those x1, x2, x3, y1,... represent respectively?? i can't make sense with these equations. Please explain further if possible. Helps will be appreciated =) [Edited by - TimChan on July 17, 2005 1:24:11 PM]

Share this post


Link to post
Share on other sites
Illco    928
I'm not sure if the following will lead to the above equations. First we must know what the cross product of two vectors means geometrically. If we compute the cross product of a vector V1 and V2, and V1 and V2 are orthogonal to each other, the result vector V3 = V1 x V2 will be orthogonal to both. If we apply this to a plane case, we know that for any two vectors V1 and V2 that are in the plane, their cross product will yield the plane normal.

Two arbitrary vectors in the plane can be formed by subtracting two vertices from each other. Hence, if we have three vertices in a plane, say P1=(x1,y1,z1), P2=(x2,y2,z2) and P2=(x3,y3,z3) we can compute the plane normal as follows.


V1 = (P2 - P1);
V2 = (P3 - P2);
V3 = V1 X V2


If you write this out you will get the formula for V3, which is the plane normal. The equations above (OP) show the substitution of such points P1, P2 and P3 into the plane equation. Hope it helps. Greetz,

Illco

Share this post


Link to post
Share on other sites
TimChan    109
thanks in advance...

anyway, is the following code correct?

class plane
....
plane(float x, float y, float z, float distance) {
m_vNormal = vector3(x, y, z);
m_vNormal.Normalize();
m_fDistance = distance;
}

Share this post


Link to post
Share on other sites
Illco    928
Quote:
Original post by TimChan
anyway, is the following code correct?

class plane
....
plane(float x, float y, float z, float distance) {
m_vNormal = vector3(x, y, z);
m_vNormal.Normalize();
m_fDistance = distance;
}

That depends on what you mean by it. If it means that the plane is initialized to having a normal (x,y,z) then it is correct but it doesn't give you a plane equation; it just stores the supplied normal and distance.

Share this post


Link to post
Share on other sites
Dmytry    1151
Quote:
Original post by TimChan
Hi, i'm confused about finding the normal of a plane, which formed by a point(x, y, z) and the distance between the origin and that plane.

If plane have equation
x*p.x+y*p.y+z*p.z + D=0
where p.x, p.y, p.z, D is constants defining the plane, then normal of plane is p.x, p.y, p.z (and it have other normal -p.x, -p.y, -p.z , of course)

(if you need unit-length normal, normalize it. Chances are, it is already normalized)

It's hard to understand what precisely you want, though.

Share this post


Link to post
Share on other sites
JohnBolton    1372
If I understand correctly, you want to find a plane given a point on the plane and the distance from the origin to the plane.

You can't. There are an infinite number of solutions.

On the other hand, the equations you posted look like they are finding a plane from three points, not a point and a distance.

Share this post


Link to post
Share on other sites
Dmytry    1151
I thought that this "plane defined by point and distance from plane to origin" is just poorly worded
x*p.x+y*p.y+z*p.z + d = 0
where p is "point" (actually it is _normal_) and d is "distance".

Indeed, plane can not be specified by point on plane (arbitrarely placed) and distance from plane to origin alone.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this