# Plane Equation

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

## Recommended Posts

I have asked this before in this thread when I didn't understand. As I read it now I definitly think I would deserve to be rated down for that. I was pissing you off, but no article explained that well so I could understand it. Now I understod I had to try harder to understand. So I have checked it out at Wikipedia. But I think I got it now. It was said that the parameter B was pointing as the normal right up at the face. But in what directions are the other two parameters pointing then? Then I got the idea that the parameters are koeffient (like ratio) values that tells how much it differs from the world's xyz axis. Therefore my guess is: A * x + B * y + C * z + D = 0 Is the same as: A * x + B * y + C * z = -D x is the x axis delta from the plane's origin to the actual point y is the y axis delta from the plane's origin to the actual point z is the z axis delta from the plane's origin to the actual point A is the value for how the plane's x axis differs from the world's x axis. B is the value for how the plane's y axis differs from the world's y axis. C is the value for how the plane's z axis differs from the world's z axis. D is the length formed by sqrt(x*x + y*y + z*z) So I just need to be confirmed if this is true. Thanks in advance!

##### Share on other sites
A, B and C are essentially a normal to the plane, < A, B, C >. Remember a normal is a vector - a distance, not a position. D is to establish position, and is the distance between the origin and the plane, along the normal vector.

##### Share on other sites
Where's the origin and the point to check at the picture fig(3)?
Is the origin where x, y and z meets?
Is the point the black dot in the other end of D?

Is the magnitude of a vector the same as the length?

Is the vectors xyz component the delta (the difference) the displacement between two points.

To get the magnitude, do one write |AB|? where A and B is two points.

Do one get the length by sqrt(x*x + y*y + z*z).

Is it like this then:

A*x + B*x + C*z + D = 0

A,B,C the normal vector direction.
x,y,z the delta between the origin and the point to check.
D the distance between formed by sqrt(x*x + y*y + z*z)

If the point lies in the plane the expression(equation) then will be true, equal zero.

##### Share on other sites
Your understanding of x, y, z, and D is not correct.

I normally explain the whole thing the following way, where a bold uppercase letter denotes a point, and a bold lowercase letter denotes a direction vector.

To understand it totally, you first have to know a consequence of the dot product:
a . b = |a| * |b| * cos( < a,b > )
Read this as follows: The dot product of two direction vectors is proportional to the length of each vector and the cosine of the angle between the both vectors. For simplicity, let us assume that a is of unit length, so it could be seen that the dot product will result in the length of the projection of b onto a, or, in other words, the length of b in parallel direction of a (there is also a perpendicular component, but that doesn't play a role here).

Now, let us define a distance formula like this
d := ( P - O ) . n
where P and O denotes two points, and n a direction vector.

With this, a plane equation in Hessian normal form is given by
P := ( P - O ) . n = 0
where O (from "origin", not a zero!) denotes any point on the plane, and n denotes the plane's normal.

What does the definition express? Look at the dot product inside. It says: The projected length of the difference vector of any point P in the space and the origin of the plane must be 0 for P being part of the plane. Any P set into the equation above that result in a distance not equal to zero is distant of the plane and hence not part of the plane.

Next, resolve the brace to yield in
P . n - O . n = 0
and remember that that P is variable but O and n are fixed parameters for a given plane. Hence the right dot product could be computed as a scalar
- O . n =: D
From the definition of the dot product this is the (negated) length of the projected difference vector between the space origin and the plane origin, or, in other words, the distance of the plane from the space origin! (Notice that negative values may occur since the direction of the normal plays a role; so D is not really a distance!) To be precise, the full form would be
- ( O - 0 ) . n =: D
where the subtracted 0 (a bold null) denotes the space origin, so that the point is transformed into a direction vector.

Furthurmore, if selecting the 3D space as the space of interest, the left dot product could be expressed by components as
P . n = Px * nx + Py * ny + Pz * nz

Now choose some other names:
A := nx
B := ny
C := nz
and
x := Px
y := Py
z := Pz
and after substitution you yield in the known formula
A x + B y + C z + D = 0

Hence, A, B, C are just the components of the plane's normal, and D is a distance measure of the plane from the space origin. x, y, and z are the components of any space point that is either part of the plane if they fulfil the equation, or else not.

Quote:
 Original post by programeringA,B,C the normal vector direction.x,y,z the delta between the origin and the point to check.D the distance between formed by sqrt(x*x + y*y + z*z)

With looking at the explanation above, 1st line is true, 2nd and 3rd are false.

Quote:
 Original post by programeringTo get the magnitude, do one write |AB|? where A and B is two points.

Yes, but normally (at least in Germany) a horizontal bar has to be written over it (unfortunately I don't know how to make them in HTML). The two vertical bars denote the "absolute value" or "lenght" or "magnitude" (it is a notion of the so-called 2-norm). If A and B denote two points, then AB denote the difference vector from A to B, computed as
AB = B - A

EDIT: As Taralieth has pointed out absolute correctly, the dot product shows the cosine (not the sine) between the both vectors. Already corrected above. Thx.

[Edited by - haegarr on April 6, 2006 7:14:28 AM]

##### Share on other sites
Quote:
 Original post by haegarrYour understanding of x, y, z, and D is not correct.I normally explain the whole thing the following way, where a bold uppercase letter denotes a point, and a bold lowercase letter denotes a direction vector.To understand it totally, you first have to know a consequence of the dot product:a . b = |a| * |b| * sin( < a,b > )Read this as follows: The dot product of two direction vectors is proportional to the length of each vector and the sine of the angle between the both vectors. For simplicity, let us assume that a is of unit length, so it could be seen that the dot product will result in the length of the projection of b onto a, or, in other words, the length of b in parallel direction of a (there is also a perpendicular component, but that doesn't play a role here)....

Small correction to Haegarr. The dot product is actually the length of each vector times cosine of the angle in between both vectors. Otherwise I agree with what Haegarr wrote.

Quote:
 Original post by haegarrWith this, a plane equation in Hessian normal form is given byP := ( P - O ) . n = 0where O (from "origin", not a zero!) denotes any point on the plane, and n denotes the plane's normal.What does the definition express? Look at the dot product inside. It says: The projected length of the difference vector of any point P in the space and the origin of the plane must be 0 for P being part of the plane. Any P set into the equation above that result in a distance not equal to zero is distant of the plane and hence not part of the plane.

Another way you can think about it is that if P is a point along the plane, then P - O gives you a vector along the plane since both P and O is on the plane. That means that the vector P - O must be perpendicular to the normal of the plane which means the dot product of them must be 0 (i.e. |P|*|O|*cos90 = 0)

##### Share on other sites
programering

I wrote a Word document which explains planes in depth.

I would've posted it here in this thread, but it's a bit tricky trying to post a few pages of screen shots.

If you'd like to view it, send me a private message and I could email you the doc.

##### Share on other sites
I have googled for plane equation
to see if I could find articles about it that
explain it well so I would get to understand it better.
And I choosed the article "Polygons and the Plane Equation" in the list,
and that explained well and got me to understand that right now.

The triangle with the vertices A, B and C.

1. First you get the normal of a surface by the
cross product of the two vectors U and V between the
vertices A-B and A-C pointing out from any
vertex in the triangle, in this case the vertex A.
That's A, B and C are the normal vector x, y and z components.
The normal have no position in space, it just specifies the direction.

2. Second you normalize the normal vector to give it a length
of 1 by dividing every A, B and C component by 1.

3. Third you get the D component from the dot product of the
normal and any vertex point of the triangle.

A*x + B*y + C*z + D = 0

A, B and C are the normal vector's x, y and z components.

D is the value of the dot product of the normal and any
vertex point in the triangle (must it be the same vertex
that was the center of the two vectors of between the
vertices A-B and A-C, in this case A?).

x, y and z are the point to check if it is in the plane
(Is it the delta from the center vertex A?).

If (A*x + B*y + C*z + D) > 0 Then the point is above the plane
If (A*x + B*y + C*z + D) = 0 Then the point is in the plane (coplanar)
If (A*x + B*y + C*z + D) < 0 Then the point is below the plane

Is it right now then?

##### Share on other sites
Quote:
 Original post by programering1. First you get the normal of a surface by the cross product of the two vectors U and V between the vertices A-B and A-C pointing out from any vertex in the triangle, in this case the vertex A.

Yes. The principles behind this are: A cross product of two non-colinear (!) and not zero length (!) vectors is a vector perpendicular to both of its input vectors. For the normal of a surface you have to pick the point of which you need to know the normal, compute 2 tangential vectors and the cross product from them. In your case the surface is planar, so that any 2 non-colinear vectors inside the surface are good as tangential vectors, and the normal will furthurmore be the same at all points on the surface.

Quote:
 Original post by programering That's A, B and C are the normal vector x, y and z components.

Yes. (However, notice that A, B, and C are used as positions in space in the image, so it is a little bit confusing here to use the same variable names (you may consider to use the bold kind of writing for vectors in the future)).

Quote:
 Original post by programering The normal have no position in space, it just specifies the direction.

Correct. A normal is a direction vector, and direction vectors have no position. This difference to position vectors (or "points") is important for transformations. That is why I differ also in writing a upper case letter A for a position vector and a lower case u for direction vectors.

Quote:
 Original post by programering2. Second you normalize the normal vector to give it a length of 1 by dividing every A, B and C component by 1.

Err, no. "Normalization" is the operation to make a vector unit length, that's right. To do so, you compute its length and divide each component by this length:
n' := n / |n| = [ x/|n| y/|n| z/|n| ]
where
|n| := sqrt( x*x + y*y + z*z )
in 3D space.

Notice please that A,B,C are points in space. Points could not sensefully be normalized.

Notice furthur that it isn't sufficient to normalize u and v, since the normal is computed as the cross product of u and v, and there is a sine in-between:
|u x v| := |u| * |v| * |sin( <u,v>)|
So, until you guarantee that the angle between u and v isn't +/-90° (so that the sine becomes +/-1) you have to normalize _after_ the cross product.

You could furthur see from the sine why the both vectors must not be co-linear, or else the angle between will be 0° or 180°, and its sine will be 0 making the cross product disappear.

Quote:
 Original post by programering3. Third you get the D component from the dot product of the normal and any vertex point of the triangle.

Closely. First, notice the negation, since the D is the negative dot-product of the normal and any point on the surface. Second, (as already mentioned) you could use _any_ point of the surface, so of course also one of the vertices. The dot-product does a projection, so it plays no role what point you use as long as it is on the surface.

Quote:
 Original post by programeringA*x + B*y + C*z + D = 0A, B and C are the normal vector's x, y and z components.

Yes. That fact comes from the definition of the dot-product.

Quote:
 Original post by programeringD is the value of the dot product of the normal and anyvertex point in the triangle (must it be the same vertexthat was the center of the two vectors of between thevertices A-B and A-C, in this case A?).

See above. Absolutely any point on the (planar) surface could be used.

Quote:
 Original post by programeringx, y and z are the point to check if it is in the plane(Is it the delta from the center vertex A?).

It is any point in space.

Quote:
 Original post by programeringIf (A*x + B*y + C*z + D) > 0 Then the point is above the planeIf (A*x + B*y + C*z + D) = 0 Then the point is in the plane (coplanar)If (A*x + B*y + C*z + D) < 0 Then the point is below the plane

Yes, but this needs one more definition: Here "above" means "in direction of the normal", and "below" means "against the direction of the normal". If you negate the normal (what will denote the same surface) the meaning of "above" and "below" will just exchange.

Furthurmore I'm not sure about the term "coplanar" w.r.t. points. I think only planes could be co-planar.

Good job :) I think you mostly has understood the topic now.

##### Share on other sites
Quote:
 Original post by haegarrGood job :) I think you mostly has understood the topic now.

Not quite, there's still things to clear out.

It is of very great value I get to understand this.
Cos I want to understand this.

Quote:
Original post by haegarr
Quote:
 Original post by programering1. First you get the normal of a surface by the cross product of the two vectors U and V between the vertices A-B and A-C pointing out from any vertex in the triangle, in this case the vertex A.

Yes. The principles behind this are: A cross product of two non-colinear (!) and not zero length (!) vectors is a vector perpendicular to both of its input vectors. For the normal of a surface you have to pick the point of which you need to know the normal, compute 2 tangential vectors and the cross product from them. In your case the surface is planar, so that any 2 non-colinear vectors inside the surface are good as tangential vectors, and the normal will furthurmore be the same at all points on the surface.

What's colinear?
What does "co" stand for?
What's tangential? Is it touching?
What does the "surface is planar" mean?

Quote:
Original post by haegarr
Quote:
 Original post by programering That's A, B and C are the normal vector x, y and z components.

Yes. (However, notice that A, B, and C are used as positions in space in the image,
so it is a little bit confusing here to use the same variable names (you may consider to use the bold kind of writing for vectors in the future)).

Do you mean the triangle's vertices A, B and C?

Quote:
Original post by haegarr
Quote:
 Original post by programering The normal have no position in space, it just specifies the direction.

Correct. A normal is a direction vector, and direction vectors have no position. This difference to position vectors (or "points") is important for transformations. That is why I differ also in writing a upper case letter A for a position vector and a lower case u for direction vectors.

So both the (A, B and C) and (x, y and z) vectors are the normal.
A, B and C are the position vector in uppercace.
x, y and z are the direction vector in lowercase.

Quote:
Original post by haegarr
Quote:
 Original post by programering2. Second you normalize the normal vector to give it a length of 1 by dividing every A, B and C component by 1.

Err, no. "Normalization" is the operation to make a vector unit length, that's right. To do so, you compute its length and divide each component by this length:
n' := n / |n| = [ x/|n| y/|n| z/|n| ]
where
|n| := sqrt( x*x + y*y + z*z )
in 3D space.

void Normalize(Vector *vect)
{// shall it be integers or real numbers as float and double?
int length = GetLength(vect);
vect->x /= length;
vect->y /= length;
vect->z /= length;
}

int GetLength(Vector *v)
{// shall it be integers or real numbers as float and double?
return sqrt(v->x*v->x + v->y*v->y + v->z*v->z);
}

Quote:
 Original post by haegarrNotice please that A,B,C are points in space. Points could not sensefully be normalized.

So it is the normal's direction vector by the components x, y and z which get normalized.

Quote:
 Original post by haegarrNotice furthur that it isn't sufficient to normalize u and v, since the normal is computed as the cross product of u and v, and there is a sine in-between:|u x v| := |u| * |v| * |sin( )|So, until you guarantee that the angle between u and v isn't +/-90° (so that the sine becomes +/-1) you have to normalize _after_ the cross product.

The length of the vector from the cross product of u and v shall equal the length of u and v * eachother * sin(the angle between u and v)

Quote:
Original post by haegarr
Quote:
 Original post by programeringx, y and z are the point to check if it is in the plane(Is it the delta from the center vertex A?).

It is any point in space.

Is it the point in space to be checked if it is in the plane?

Quote:
Original post by haegarr
Quote:
 Original post by programeringIf (A*x + B*y + C*z + D) > 0 Then the point is above the planeIf (A*x + B*y + C*z + D) = 0 Then the point is in the plane (coplanar)If (A*x + B*y + C*z + D) < 0 Then the point is below the plane

Yes, but this needs one more definition: Here "above" means "in direction of the normal", and "below" means "against the direction of the normal". If you negate the normal (what will denote the same surface) the meaning of "above" and "below" will just exchange.

Quote:
 Original post by haegarrFurthurmore I'm not sure about the term "coplanar" w.r.t. points. I think only planes could be co-planar.

What does "v.r.t. points" means?

Thanks for helping me out.
It's a bit hard for me to understand, but I do my best.
I would have rated you, but it won't have any effect
since I have much lower than you, otherwise I would.

When I finally get to understand things, I will write articles which explains it very well so people like me can understand.
But I seem to be the only one who don´t understand things here.

##### Share on other sites
Ok; I'll add my few cents below with some additions. I've tried to avoid specific mathematical definitions as you can find them -- a more natural-language oriented approach seemed more appropriate.

Quote:
 What's colinear?

It means the vectors directions are the same, regardless of their length. So for example, two vectors (0,1,0) and (0,100,0) are colinear. That is not the whole story: (0,1,0) and (0,-1,0) are also colinear as their directions are on the same line, and you might abusingly think of the one as the other with negative length.

Quote:
 What does "co" stand for?

It's a prefix to indicate the term colinear relates two a pair of vectors rather than a single one. Think in general of co-pilot, co-driver, co-operate, etc.

Quote:
 What's tangential? Is it touching?

Yes it's touching. If you have a parabola then the tangent on the top will be horizontal, for example.

In this case, the explanation tries to tell the following. Normally, for an arbitrary curved surface, to compute the normal vector you would require two vectors that are tangents of the surface i.e. touching it's curvature. The tangents are orthogonal to each other as well as to the normal.

In this case, since the surface is planar, it is not required that the two vectors for computing the normal are orthogonal to each other; any two actually different (non-colinear) vectors in the plane will do.

Quote:
 What does the "surface is planar" mean?

It means the surface is not curved, but flat. If you would have an infinitely flat plane, you could position such that it fits together with any planar surface. You cannot do this with non-planar surfaces, as the curvature will at some point move away from your infinite plane.

Actually a flat plane is a tautology: planes are always flat whereas surfaces can be curved.

Quote:
 Shall it be integers or real numbers as float and double?

In general these computations are done using floating-point numbers, so stick to those for now.

Quote:
 What does "w.r.t. points" means?

It means "with respect to points" i.e. how the term coplanar should be interpreted in the context of points.

FYI: coplanar points are points lying in the same plane. So any two points will be coplanar, as will be any three points but not any four points (in R^3, naturally).

Greetz,

Illco

##### Share on other sites
Because you self know this so well you explain it in a higher knowing level that you understand.
But I need to get to know the basics first.

Quote:
Original post by Illco
Quote:
 Original post by programeringWhat's colinear?

It means the vectors directions are the same, regardless of their length. So for example, two vectors (0,1,0) and (0,100,0) are colinear. That is not the whole story: (0,1,0) and (0,-1,0) are also colinear as their directions are on the same line, and you might abusingly think of the one as the other with negative length.

Good explaination, I get it, thanks!

Quote:
Original post by Illco
Quote:
 Original post by programeringWhat does "co" stand for?

It's a prefix to indicate the term colinear relates two a pair of vectors rather than a single one. Think in general of co-pilot, co-driver, co-operate, etc.

Ok.

Quote:
Original post by Illco
Quote:
 Original post by programeringWhat's tangential? Is it touching?

Yes it's touching. If you have a parabola then the tangent on the top will be horizontal, for example.

parabola? Is it the TV receiver of the satelite?

Quote:
 Original post by IllcoIn this case, the explanation tries to tell the following. Normally, for an arbitrary curved surface, to compute the normal vector you would require two vectors that are tangents of the surface i.e. touching it's curvature. The tangents are orthogonal to each other as well as to the normal.

What's arbitrary? I couldn't find it in the game dictionary.
So to get the normal of a curved surface you take the cross product from two tangential vectors that touches the surface in both ends.

Quote:
Original post by Illco
Quote:
 Original post by programeringWhat does the "surface is planar" mean?

It means the surface is not curved, but flat. If you would have an infinitely flat plane, you could position such that it fits together with any planar surface. You cannot do this with non-planar surfaces, as the curvature will at some point move away from your infinite plane.

Ok.

Quote:
 Original post by IllcoIn this case, since the surface is planar, it is not required that the two vectors for computing the normal are orthogonal to each other; any two actually different (non-colinear) vectors in the plane will do.

Quote:
 Original post by IllcoActually a flat plane is a tautology: planes are always flat whereas surfaces can be curved.

Ok.

Quote:
Original post by Illco
Quote:
 Original post by programeringShall it be integers or real numbers as float and double?

In general these computations are done using floating-point numbers, so stick to those for now.

Ok.

Quote:
Original post by Illco
Quote:
 Original post by programeringWhat does "w.r.t. points" means?

It means "with respect to points" i.e. how the term coplanar should be interpreted in the context of points.

BTW, what does "i.e." stand for?

Quote:
 Original post by IllcoFYI: coplanar points are points lying in the same plane. So any two points will be coplanar, as will be any three points but not any four points (in R^3, naturally).

I understand.

I think I get it now :-).

A*x + B*y + C*z + D = 0

A, B, and C are the point of the normal. Uppercase for point vectors.
x, y and z are the direction of the normal. Lowercase for direction vectors.
D is the dot product of the point and direction vectors which returns the
distance for the space origin to the plane.

If (A*x + B*y + C*z + D) < 0, then the point is?
If (A*x + B*y + C*z + D) = 0, then the point is in the plane.
If (A*x + B*y + C*z + D) > 0, then the point is?

##### Share on other sites
I'm not going to try and answer all the questions about planes because I'm not that solid on the math, but I'll help out by answering some of the definitions you're having problems with.

Quote:
 parabola? Is it the TV receiver of the satelite?

A parabola is simply any curve fitting the equation: y = ax^2 + bx + c

Quote:
 What's arbitrary? I couldn't find it in the game dictionary

Arbitrary is a general term meaning any one out an infinite number of possibilities. So an arbitrary curve surface would be any curved surface you can think of.

Quote:
 BTW, what does "i.e." stand for?

i.e. is a latin abbreviation. It is short for id est, which means 'that is'. So when someone says i.e. they are basically just clarifying a statement they just made. Similarly, the abbreviation e.g. is short for 'exempli gratia' and means 'for example'. From wikipedia:
Quote:
 Exempli gratia (e.g.) and id est (i.e.) are commonly confused and misused in colloquial English. The former, exempli gratia, means "for example", and is used before giving examples of something ("I have lots of favorite colors, e.g., blue, green, and hot pink"). The latter, id est, means "that is", and is used before clarifying the meaning of something, when elaborating, specifying, or explaining rather than when giving examples ("I have lots of favorite colors, i.e., I can't decide on just one"). Both "e.g." and "i.e." should generally be followed by a comma, just as "for example" and "that is" would be.

FYI does mean For Your Information.

##### Share on other sites
I'm just sort of jumping in here without having read the whole thread, but...
Quote:
 Original post by programeringA, B, and C are the point of the normal. Uppercase for point vectors.x, y and z are the direction of the normal. Lowercase for direction vectors.D is the dot product of the point and direction vectors which returns thedistance for the space origin to the plane.
The terminology you're using there seems a little confused (it may just be a language issue). The difference between points and vectors can be a little slippery, but in the plane equation, (A, B, C) is a vector, otherwise known as the plane normal, and (x, y, z) is any point. Those points (that is, values for x, y and z) for which the equality holds are on the plane.

Your definition of D is pretty close. In this particular form of the plane equation, it's actually the negative of the dot product of any point known to be on the plane, with the plane normal (the term normal is preferred to 'direction vector' here). If the normal is unit length, D is in fact the (signed) distance from the origin to the plane.

And:
Quote:
 If (A*x + B*y + C*z + D) < 0, then the point is behind the planeIf (A*x + B*y + C*z + D) = 0, then the point is in the plane.If (A*x + B*y + C*z + D) > 0, then the point is in front of the plane
Where 'behind' and 'in front' refer somewhat informally to the negative and positive half-space associated with the plane.

##### Share on other sites
Quote:
Original post by jyk
I'm just sort of jumping in here without having read the whole thread, but...
Quote:
 Original post by programering...
The terminology you're using there seems a little confused (it may just be a language issue). The difference between points and vectors can be a little slippery, but in the plane equation, (A, B, C) is a vector, otherwise known as the plane normal, and (x, y, z) is any point.

Yes, and sorry for that little confusion. Perhaps I have introduced it because I have not mentioned explicitely that I write vectors in bold weight, hence position vectors are written as bold uppercase letters and direction vectors as bold lowercase letters in my replies above (as in any post I've done on GDnet). Scalars, on the other hand, are written in normal weight by me.

##### Share on other sites

So for the normal that defines the plane (N) and a point (p) with vector (p - 0 = P) and (d) is some scalar distance.

N . P = d

defines some plane.

And ( Nx, Ny, Nz, -d ) is the four-component plane equation.

##### Share on other sites
Quote:
 Original post by BoderSo for the normal that defines the plane (N) and a point (p) with vector (p - 0 = P) and (d) is some scalar distance.N . P = ddefines some plane.

Yes. But the above use of uppercase and lowercase letters for vectors is reverse to my use in previous replies. In the notation of previous replies it would look like
n . p == d w/ p := P - 0
(read it as "vector n dot vector p is identical to scalar d with p being defined as the difference of point P and the origin point 0").

Notice please that both the normal and the distance is needed to define a plane, while the point is a variable. The definition means verbosely "a plane is build of all those points in the 3D space that fulfil the plane equation; any point not fulfilling the plane equation lies outside the plane, either in the "positive halfspace" (w.r.t. the direction of the planes normal) or in the "negative halfspace".

Quote:
 Original post by BoderAnd ( Nx, Ny, Nz, -d ) is the four-component plane equation.

The tuple defines the parameters of a kind of plane equation. The equation itself is
nx*px + ny*py + nz*pz - d == 0
with px, py, and pz being the variables of the equation.

##### Share on other sites
I have read some articles here to better understand this.

Is this true?:

• One normalize both the normal's
point vector <A,B,C> and
the direction vector <x,y,z>
to make them unit vectors with
the magnitude/length of 1.

• The Cross Product of two vectors
returns a vector orthogonal/perpendicular/
(right angle)/(90 degrees) to both.

[Edited by - programering on April 24, 2006 3:53:40 PM]

##### Share on other sites
Quote:
 One normalize both the normal'spoint vector andthe direction vector to make them unit vectors withthe magnitude/length of 1.
Where did you get this exactly? Is it an excerpt from an article or tutorial?

##### Share on other sites
Quote:
Original post by jyk
Quote:
 One normalize both the normal'spoint vector andthe direction vector to make them unit vectors withthe magnitude/length of 1.
Where did you get this exactly? Is it an excerpt from an article or tutorial?

A Texture Mapping Technique
Why? Is it wrong?

##### Share on other sites
The following answers may seem nitpicking, but look at all the related problem posts arised here in GDnet, and you will see the sense. I'm not a mathematician, so I may be unprecise but hopefully not wrong in the one or other formulation.

Quote:
 Original post by programeringOne normalize both the normal'spoint vector andthe direction vector to make them unit vectors withthe magnitude/length of 1.

The distinction between position vectors and direction vectors could be done in two ways: Either using homogeneous co-ordinates or by defining a suitable vector algebra (say rules like "a point minus a point results in a direction"). Using the homogeneous co-ordinates has IMHO the advantage to see some things directly.

If you apply the length formula to a position vector in homogeneous co-ordinates you get
sqrt( x2 + y2 + z2 + 12 )
what actually is the length of the vector in a mathematical sense but not the value you are looking for. What you want to see instead is the "distance of the point from the origin"!

On the other hand, computing the same for a direction vector will yield in
sqrt( x2 + y2 + z2 + 02 )
what is okay.

Computing the length of the difference vector of a point P := (x y z 1) and the origin 0 := (0 0 0 1)
|P - 0| = | ( x-0 y-0 z-0 1-1 ) | = sqrt( x2 + y2 + z2 )
does the trick.

Compare this with the rule I gave as example for a vector algebra rule above: "a point minus a point results in a direction". See that exactly that is done here!!

Now, we could also do the normalization step. Let us define
d := |P| = sqrt( x2 + y2 + z2 + 1 )
and apply that to yield in
P' := P / d = ( x/d y/d z/d 1/d )
The length of this vector is 1. Okay, now let us compute the affine vector from it:
( x y z )
Err, is that a vector of length 1? No, of course not.

In other words: A position vector is not suitable to compute a length from. If you say "I compute the length of a vector" you ever mean "of a direction vector". If you say "I compute the length of a position vector" you are wrong; what you wanted to say is "I compute the distance of a point from the origin" and you mean "I compute the length of the difference vector of the point from the origin".

Similarly, a normal is a direction vector and hence does not have an associated position. So the term "the normal's point vector" from the OP is also not correct. You could convert a direction to a point only by adding the direction to a point (notice that this is just an equivalence transformation of the one rule of the algebra I have given above!).

In summary, IMHO there are 2 mistakes in the cited sentence above.

Quote:
 Original post by programeringThe Cross Product of two vectorsreturns a vector orthogonal/perpendicular/(right angle)/(90 degrees) to both.

This is true in many cases but not in general. To be true both original vectors
(a) must not be of zero length, and
(b) must not be co-linear.
You have isolated the sentence from its original context, and perhaps the context have decribed a situation where that conditions were fulfilled.

##### Share on other sites
Quote:
 This is true in many cases but not in general. To be true both original vectors(a) must not be of zero length, and(b) must not be co-linear.You have isolated the sentence from its original context, and perhaps the context have decribed a situation where that conditions were fulfilled.

It's true in those cases as well (if one of the above conditions are met, the cross product in question will be the zero vector, which is orthogonal to ALL vectors).

##### Share on other sites
Quote:
Original post by Muzzafarath
Quote:
 This is true in many cases but not in general. To be true both original vectors(a) must not be of zero length, and(b) must not be co-linear.You have isolated the sentence from its original context, and perhaps the context have decribed a situation where that conditions were fulfilled.

It's true in those cases as well (if one of the above conditions are met, the cross product in question will be the zero vector, which is orthogonal to ALL vectors).

I disagree (until being corrected ;)

Orthogonality means an angle of 90° between the vectors. I could not see how an angle is defined anyway if one or both of the vectors is of length 0.

From the dot-product
a . b := |a| * |b| * cos( <a,b> )
one can see that an arbitrary angle could be assumed as soon as one of |a| or |b| is 0. So I could also say the angle is 45° or whatever. Hence the dot-product does not tell us anything senseful about the angle if not both vector lengthes differ from 0.

A similar argumentation could be given for the sine if using the cross-product.

At least, all my sources (say math books) inclusive and especially the Bronstein/Semendjajew state
"Orthogonality of two vectors is given if
a . b == 0, and neither a nor b is identical to the null vector."

##### Share on other sites
That's odd - I've never seen anyone make that distinction (and it seems totally unnecessary). See for example Mathworld or PlanetMath.

Quote:
 Orthogonality means an angle of 90° between the vectors. I could not see how an angle is defined anyway if one or both of the vectors is of length 0.

It is very easy to get around this problem - stop thinking about things so concretely.

##### Share on other sites
Unit vectors are the direction.

##### Share on other sites
Quote:
 Original post by haegarrOrthogonality means an angle of 90° between the vectors. I could not see how an angle is defined anyway if one or both of the vectors is of length 0.

But then how do you define orthogonality in an arbitrary dimension? Two vectors forming a 90° angle is a geometric interpretation that makes sense in 2D or 3D, but what about 4D, 5D, 10D, 234D, etc. Take the special case of 1D - you can't have orthogonal vectors unless one of the vectors is the zero vector.

A number of other concepts in linear algebra rely on the zero vector being orthogonal to every vector. For instance, the second part of the Fundamental Theorem of Linear Algebra states that the row space (of an MxN matrix A, implied) is the orthogonal complement of the nullspace (in RN). For any invertible matrix, the nullspace is just the zero vector, which is then orthogonal to all the rows of A. Also, orthogonality plays an important role in computing projections into subspaces. If the zero vector wasn't allowed to be orthogonal to other vectors, then you wouldn't be able to project a point into a subspace if it was already in the subspace. This would make the mathematics inconsistent for that case and you wouldn't be able to use projections to solve, say, least-squares.

As for the cross product, there's no possible way you can define it in terms of sin for anything outside of 2D or 3D. However it's probably possible to define it in an arbitrary dimension using the "determinant trick" (shown here). Imagine it being extended to accomodate n orthonormal basis vectors along the top row, and n-1 vectors in the other rows. Then you would be taking the cross product of n-1 vectors (right there you can see that there is no meaningful geometric interpretation of an angle between an arbitrary number of vectors) to get a vector that's orthogonal to all of them. I haven't actually tested this, but in my experience with linear algebra things scale very well with dimension.

I could probably come up with a number of other examples, but those are the most pertinent.