Download presentation
Presentation is loading. Please wait.
Published byMarylou Summers Modified over 8 years ago
1
Vectors – The Cross Product Lecture 13 Wed, Sep 24, 2003
2
The Cross Product The cross product of two 3D vectors u = (u 1, u 2, u 3 ) v = (v 1, v 2, v 3 ) is defined to be u v = (u 2 v 3 – u 3 v 2, u 3 v 1 – u 1 v 3, u 1 v 2 – u 2 v 1 ).
3
The Cross Product u1u1 u2u2 u3u3 v1v1 v2v2 v3v3 u1u1 u2u2 u3u3 v1v1 v2v2 v3v3 u1u1 u2u2 u3u3 v1v1 v2v2 v3v3 = u 2 v 3 – u 3 v 2 = u 3 v 1 – u 1 v 2 = u 1 v 2 – u 2 v 1 + + +
4
Properties of the Cross Product The cross product is a vector. The cross product is defined only for 3D vectors. u v = –(v u). u v is perpendicular to both u and v. (tu) v = u (tv) = t(u v). |u v| = |u||v|sin .
5
Example: The Cross Product VectorDemo.cpp
6
Normals to Triangles Given a triangle PQR in 3D, find a unit normal to the surface. P Q R
7
Normals to Triangles Form the cross product of Q – P and R – P. P Q R R – P Q – P
8
Example: Triangle Normal Let P = (1, 1, 2), Q = (3, 1, 5), and R = (1, 0, 4). Q – P = (2, 0, 3). R – P = (0, –1, 2). (Q – P) (R – P) = (3, –4, –2). What about (R – P) (Q – P)?
9
Right-hand Coordinate System The right-hand 3D coordinate system. i j = k j k = i k i = j x y z i j k
10
Interpolating Vectors Suppose P is a vertex at the junction of three faces with normal vectors n 1 = (.7071,.7071, 0). n 2 = (.5774,.5774,.5774). n 3 = (0,.7071,.7071). If the faces are approximations to a smooth surface, what should the normal n at P be?
11
Interpolating Vectors We should let n be the normalized value of n 1 + n 2 + n 3. n 1 + n 2 + n 3 = (1.2845, 1.9916, 1.2845). n = (.4765,.7388,.4765).
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.