chun-yuan lin mathematics for computer graphics 2015/12/15 1 cg
TRANSCRIPT
Chun-Yuan Lin
Mathematics for Computer Graphics
112/04/211 CG
Coordinate Reference Frames
112/04/21CG2
See the powerpoint: Coordinate Reference Frames.ppt
Points and Vectors (1)
112/04/21CG3
There is a fundamental difference between the concept of a geometric point and that of a vector.A point is a position specified with coordinate
values in some reference frame. (depend on the choice for the frame of refernece)
A vector has properties that are independent of any particular coordinate system.
Point Properties
Frame A
Frame B
x
y P
22 yxL
Points and Vectors (2)
112/04/21CG4
Vector PropertiesWe can define a vector as the difference between two
point positions.
Vx and Vy are the projection V onto the x and the y axes.We can obtain these same vector components using two
other point positions in the same coordinate reference frames.
A vector has no fixed position within a coordinate system.We can describe a vector as a directed line segment that
has two fundamental properties: magnitude and direction.
P2
P1
V
),(),( 121212 yx VVyyxxPPV
Points and Vectors (3)
112/04/21CG5
Magnitude:
We can specify the vector direction in various ways, such as
A vector has the same magnitude and direction within a single coordinate system.
If we transform the vector to another reference frame, the value for its components and direction within that reference frame may change.
For a three-dimensional Cartesian vector representation
22yx VVV
x
y
V
V1tan
),,( zyx VVVV 222
zyx VVVV
Points and Vectors (4)
112/04/21CG6
We can give the vector direction in terms of the direction angles, α, β, γ.
The values cosα, cos β, cos γ are called the direction cosines of the vector.
Vectors are used to represent any quantities that have the properties of magnitude and direction. (force and velocity)
Vγ
β
α
z
y
x
V
VxcosV
VycosV
Vzcos
1coscoscos 222
Points and Vectors (5)
112/04/21CG7
Vector Addition and Scalar Multiplication
V2
V1
V2
V1
V1+V2
),,( 21212121 zzyyxx VVVVVVVV
),,( zyx sVsVsVsV
Points and Vectors (6)
112/04/21CG8
Scalar Product of two Vectors
This multiplication scheme is called the scalar product or dot product. (inner product)
is the projection of vector V2 in the direction of V1.
In addition to the coordinate-independent form of the scalar product.
0,cos2121 VVVV
V2V1
θ
cos2V
zzyyxx VVVVVVVV 21212121
Points and Vectors (7)
112/04/21CG9
The scalar product of two vectors is zero if and only if the two vectors are perpendicular (orthogonal)
1221 VVVV
3121321 )( VVVVVVV
Points and Vectors (8)
112/04/21CG10
Vector Product of Two Vectors
0,sin2121 VVuVVV2
V1
V1 × V2
u
Cross product
),,( 21212121212121 xyyxzxxzyzzy VVVVVVVVVVVVVV
zyx
zyx
zyx
VVV
VVV
uuu
VV
222
11121
Points and Vectors (9)
112/04/21CG11
1221 VVVV
321321 VVVVVV
3121321 VVVVVVV
Matrices (1)
112/04/21CG12
A matrix is a rectangular array of quantities, called the elements of the matrix.
We identify matrices according to the number of rows and number of columns. When the number of rows is the same as the number of columns, this matrix is called a square matrix.
63.100.046.5
00.201.060.3
22 xe
xex
x
321 aaa
z
y
x
rcrr
c
c
mmm
mmm
mmm
M
...
............
...
...
21
22221
11211 An r by c matrix
Row vectorColumn vector
Matrices (2)
112/04/21CG13
The matrix representation for a three-dimensional vector in Cartesian coordinates as
We use this standard matrix representation for both points and vectors.
z
y
x
v
v
v
V
Scalar Multiplication and Matrix Addition
112/04/21CG14
654
321M
181512
9633M
0.41.60.2
2.35.30.1
0.41.60.2
2.35.30.1
654
321
Matrix Multiplication(1)
112/04/21CG15
The product of two matrices is defined as a generalization of the vector dot product.
ABC
n
kkjikij baC
1
2822
3826
43
48223812
47253715
4)1(203)1(10
43
21
82
75
10
Matrix Multiplication(2)
112/04/21CG16
32
6
5
4
321
18126
15105
1284
321
6
5
4
AB≠BA
A(B+C)=AB+AC
Matrix TransposeThe transpose MT of a matrix is obtained by
interchanging rows and columns.
112/04/21CG17
63
52
41
654
321T
c
b
a
cba T
(M1M2)T=M2TM1
T
Determinant of a MatrixIf we have a square matrix, we can combine the
matrix elements to produce a single number called the determinant of the matrix.
112/04/21CG18
211222112221
1211det aaaaaa
aaA
BAAB detdetdet
Matrix InverseWith square matrices, we can obtain an inverse
matrix if and only of the determinant of the matrix is nonzero.
112/04/21CG19
IMMMM 11
Identity matrix