Appendix B

Properties of Vector Products

This appendix regards the basic properties of vector products and their geometric interpretation.

B.1 Dot Product

The dot product, or scalar product between two vectors is indicated with the symbol ∙ and is defined as:

ab=i=1na1b1++anbn(B.1)

This equation is a pure algebraic definition where the term vector is intended as a sequence of numbers. When we deal with a geometric interpretation where the vectors are entities characterized by a magnitude and a direction we can write:

ab=||a||||b||cosθ(B.2)

where θ is the angle formed by the two vectors. Equation (B.2) tells us a few important things.

One of these things is that two non-zero-length vectors are perpendicular to each other if and only if their dot product is 0. This is easy to verify: since their length is not 0, the only condition for the dot product to be 0 is that the cosine term is 0, which means θ = ±π/2. This notion also gives us a way to find a non-zero vector perpendicular to a given one [see Figure B.1 (Left)]:

FIGURE B.1

Figure showing dot product. (Left) a′ and a″ are built from a by swapping the coordinates and negating one of the two. (Right) Length of the projection of b on the vector a.

Dot product. (Left) a′ and a″ are built from a by swapping the coordinates and negating one of the two. (Right) Length of the projection of b on the vector a.

[,ai,,aj,][0,,0,aj,0,0,ai,0,]==aiajajai=0

and we used it in Section 5.1.2.2 to define the edge equation.

If we fix the length of two vectors, their dot product is maximum when they are parallel and equals the scalar product of their lengths. This is because we compute the length of a vector as ||a||=(aa).

Given two vectors a and b, we can use dot product to find the length of the projection of b on a:

l=ba||a||

as shown Figure B.1 (Right).

The dot product fulfills the following properties:

  • Commutative: ab = ba
  • Distributive over vector addition: a ∙ (b + c) = ab + ac
  • Scalar multiplication: (s1a) ∙ (s2b) = s1s2(ab)

But not associative, that is, (ab) ∙ ca ∙ (bc).

B.2 Vector Product

The vector (or cross) product between two vectors a and b is the vector orthogonal to both a and b and with magnitude equal to the parallelogram formed by p, p + a, p + a + b, and p + b (see Figure B.2).

FIGURE B.2

Figure showing cross product. (Top-Left) The cross product of two vectors is perpendicular to both and its magnitude is equal to the area of the parallelogram built on the two vectors. (Top-Right) The cross product to compute the normal of a triangle. (Bottom) The cross product to find the orientation of three points on the XY plane.

Cross product. (Top-Left) The cross product of two vectors is perpendicular to both and its magnitude is equal to the area of the parallelogram built on the two vectors. (Top-Right) The cross product to compute the normal of a triangle. (Bottom) The cross product to find the orientation of three points on the XY plane.

A typical mnemonic rule to compute the cross product is:

a×b=|ijkaxayazbxbybz|==i|axazbybz|+j|axazbxbz|+k|axaybxby|=i(aybzbyaz)+j(axbzbxaz)+k(axbybxay)

where i, j and k are interpreted as the three axes of the coordinate frame where the vectors are expressed.

Like for the dot product, we have a geometric interpretation of the cross product:

||a×b||=||a||||b||sinθ(B.3)

If we fix the length of two vectors, their cross product is maximum when they are orthogonal and equals the scalar product of their lengths.

Two non-zero-length vectors are collinear if and only if their cross product is 0. This is easy to verify: since their length is not 0, the only condition for their cross product to be 0 is that the sin term is 0, which means θ = π ± π.

The cross product is typically used to find the normal of a triangular face. Given a triangle T = (v0, v1, v2), we may define:

a=v1v0b=v2v0

and hence:

N=a×b

Note that ||N|| = 2Area(T) so that the magnitude of the normal corresponds to the double of the area of the triangle (we used this property in Section 5.1.3 for expressing the barycentric coordinates).

One of the most used properties of cross product is antisymmetry, that is:

a×b=b×a

If we consider a triangle t′ lying on the XY plane and compute its normal, we will obtain the vector N′ = (0,0, ±2Area(T′)). The sign of the z component depends on the order of the cross product. If we always perform the product in the same way, that is (viv0) × (v2v0), then it depends on whether the vertices are specified in a counterclockwise or clockwise order. In the first case the z component will be positive, in the latter negative, which is the property we used in Section 5.5.1 to distinguish between front-facing and back-facing triangles.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset