120 likes | 261 Views
Vectors – The Dot Product. Lecture 12 Mon, Sep 22, 2003. The Dot Product. The dot product of two vectors u = (u 1 , …, u n ) v = (v 1 , …, v n ) is u v = u 1 v 1 + … + u n v n. Properties of the Dot Product. The dot product is a scalar. u v = v u .
E N D
Vectors – The Dot Product Lecture 12 Mon, Sep 22, 2003
The Dot Product • The dot product of two vectors u = (u1, …, un) v = (v1, …, vn) is u v = u1v1 + … + unvn.
Properties of the Dot Product • The dot product is a scalar. • u v= v u. • (tu)v= u (tv) = t(u v). • u (v + w) = (uv) + (uw).
Dot Product and Angles • The most important property of the dot product is that u v= 0 if and only if u and v are perpendicular. • More generally, u v= |u||v|cos where is the angle between u and v.
Dot Product and Angles • Therefore, • u v > 0 if and only if 0 < 90. • u v = 0 if and only if = 90. • u v < 0 if and only if 90 < 180. • This is of the utmost importance in computer graphics.
Vectors and Scenes • A polygonal face is not visible to the viewer if its normal vector makes more than a right angle with the vector to the viewer. • Why? • Is the converse true?
Vectors and Scenes • A polygonal face is not lit by a light source if its normal vector makes more than a right angle with the vector to the light source. • Why? • Is the converse true?
Orthogonal Projections • The orthogonal projection of u onto v is the vector [(uv)/(vv)]v • Example: Project u = (1, 2) onto v = (3, 1). [(uv)/(vv)]v = (5/10)(3, 1) = (3/2, 1/2).
Reflections • Let L be the “light” vector from the surface to the light source. • Let N be the unit normal vector from the surface. • Let R be the reflected vector.
N L R m m e -e Reflections R = -L + 2(LN)N