















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Computer Graphics Points, Scalars and Vectors
Points, Scalars and Vectors n Points, vectors defined relative to a coordinate system
Points n Location in coordinate system n Cannot add or scale n Subtract 2 points = vector Point
Vector-Point Relationship n Diff. b/w 2 points = vector v = Q – P n Sum of point and vector = point v + P = Q P Q v
Vector Operations n Scaling vector by a scalar ( , , ) 1 2 3 a s = a s a s a s ( ( ), ( ), ( )) 1 1 2 2 3 3 = a + − b a + − b a + − b a − b Note vector subtraction: a b a a-b 2.5a
Vector Operations: Examples n Scaling vector by a scalar n For example, if a =(2,5,6) and b = (-2,7,1) and s =6, then
1 2 3 a s = a s a s a s •Vector addition: ( , ) 1 1 , 2 2 3 3 a + b = a + b a + b a + b ( , ) ( 0 , 12 , 7 ) 1 1 , 2 2 3 3 a + b = a + b a + b a + b = ( , , ) ( 12 , 30 , 36 ) 1 2 3 a s = a s a s a s =
Magnitude of a Vector n Magnitude of a n Normalizing a vector (unit vector) n Note magnitude of normalized vector = 1. i.e 2 2 2 2 1
n
.......... 1 2 2 2 2 1
Dot Product (Scalar product) n Dot product, n For example, if a =(2,3,1) and b= (0,4,-1) then 1 1 2 2 3 3
Dot Product n Try your hands at these: n ( 2, 2, 2, 2)•( 4, 1, 2, 1.1) = 8 + 2 + 4 + 2.2 = 16. n ( 2, 3, 1)•( 0, 4, -1) = 0 + 12 –1 = 11
Properties of Dot Products n Symmetry (or commutative): n Linearity: n Homogeneity: n And
2
Angle Between Two Vectors n Find the angle b/w the vectors b = (3,4) and c = (5,2)
Angle Between Two Vectors n Find the angle b/w the vectors b = (3,4) and c = (5,2) n | b |= 5, | c |= 5. = 5 4 , 5 3 ˆ b (^) b ˆ^ • c ˆ = 0. 85422 =cos θ o θ = 31. 326
Cross Product (Vector product)
x y z
x y z
If Then a b ( ) i ( ) j ( ) k y z z y x z z x x y y x × = a b − a b − a b − a b + a b − a b Remember using determinant x y z x y z
Note: a x b is perpendicular to a and b
Cross Product Note: a x b is perpendicular to both a and b a x b a 0 b