Professional Documents
Culture Documents
Vector Calculus: Mengxia Zhu Fall 2007
Vector Calculus: Mengxia Zhu Fall 2007
Vector Calculus: Mengxia Zhu Fall 2007
Mengxia Zhu
Fall 2007
Objective
Review vector arithmetic
Distinguish points and vectors
Relate geometric concepts to their
algebraic representation
Describe point, line, and planes
Exploit the dot product and cross product
and their applications in Graphics
Basic Entities
{2, 3, 9}
P
V=Q-P
y
Right-hand system
z
Left-hand system
Vector-scalar multiplication
-v
Vector addition
v1+v2
v1
v1
v1-v2
v2
v1
v1-v2
v1
v2
v2
v2
a v
i 1
v2 v=(1-a)v1 + av2
= V1+a(V2-V1)
a(V2-V1)
v1
v2
v1
Normalize a vector
v v v2 ... vn
2
1
v
v
v
Point-vector addition
Subtraction of two points P and Q gives a
vector v: v=P-Q
Adding a vector v to point Q gives a point
K: K=Q+u
P
Dot product
v vgv
u gv u v cos
v
u
v
v
u
u gv 0
u
v
u gv 0
u gv 0
Cross Product
Cross Product
v u n v u sin
vu 0
vxu
v
uxv
Operation Calculation
Operation Calculation
Homogeneous representation
Ordinary coordinate system, points and vectors are represented the same. However, they
are quite different.
Points have location, no direction and size. Vector has no location, but with direction and
size.
v1
v2
Homogeneous representation
OpenGL uses 4D homogeneous
. coordinates for all its vertices.
Point: (x,y,z,1)
Vector: (x,y,z,0)
Line
C
C
L(t ) C bt
b B C
t>1
L
C
t=0
t<0
t=1
Parametric Plane
point form
Parametric representation
Point normal form
Parametric form
Equation
P(s,t) = C + as + bt
a = A-C, b = B-C
b
C
B
a
P(s,t) = sA+tB+(1-s-t)C
ng( R B ) 0
Tweening
void drawTween ( Point A[], Point B[], int n, float t)
{
for (int i= 0; i< n; i++)
{
Point p;
P = Tween(A[i], B[i], t);
if ( i == 0 ) moveTo (Px, Py);
else
lineTo (Px, Py);
}
}