CS 3388Working with 3D Vectors
[Hill §4.1—4.4]
xz
y
(1,2,0)(1,2,2)
2
Vector Spaces
• The space Rn is a vector space because it is closed under
• Setting n=3 is special case
u,v 2 Rn ) u + v 2 Rn
v 2 Rn, ® 2 R ) ®v 2 Rn
vector addition:
scalar multiplication:
3
k-Flats and Subspaces
• A subspace is a subset of points• A k-flat is a subspace “congruent” to a
vector space of dimension k • A point is a 0-flat
• A line is a 1-flat
• A plane is a 2-flat xz
y
u
u
v
4
Vector Norm
• Identities:
(triangle inequality)
5
3D Dot Product
• Also known as inner- or scalar product since
• Notice • If assume (column vectors)
6
Dot Product
• Identities:
• Geometry:xz
y
µ
b
a
Therefore…
7
Dot Product as Projection
• The value is the length of a projected onto b multiplied by
• If then
a
b
a
b
8
Sign of Dot Product
• If then a and b facing similar directions
• If then a and b facing opposite directions
• Useful for detecting front-facing and back-facing surfaces (much later
a
9
Cross Product
• Also called vector product, as• Way to remember order:
(2£2 determinants)
careful!
10
Geometry of Cross Product
• The vector where
• If and
then
• If then xz
y b
a
c µ
“c orthogonal to a and to b”“c has unit norm”
11
Cross Product Identities
these follow from
12
Normal Vectors
• Let be a surface (dimension 2)• For each surface point define
• A normal at is any such that for all
n
v
p q p
13
Normals for Planes
• For a plane (2-flat), point doesn’t matter because
• Given with can compute a normal
• Can calculate u,v from 3 non-colinear points
xz
y
n
u
v
(vectors tangential to plane do not change with position)
xz
y
q
rp
14
Calculating a Normal
• Let define a plane
xz
y
q
r p
“Calculemus!”---Leibniz
(i.e. do it on blackboard)
xz
y
n