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

Started by
6 comments, last by Dmytry 18 years, 9 months ago
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]
Advertisement
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
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;}
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.
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.
ok, i know what should i do now. so thanks for ur helps.
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.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
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.

This topic is closed to new replies.

Advertisement