math review week 1, wed jan 6
DESCRIPTION
http://www.ugrad.cs.ubc.ca/~cs314/Vjan2010. Math Review Week 1, Wed Jan 6. News. no class this Friday (Jan 8)! UBC CS Dept news. Department of Computer Science Undergraduate Events. Events this week How to Prepare for the Tech Career Fair Date: Wed. Jan 6 Time: 5 – 6:30 pm - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/1.jpg)
University of British ColumbiaCPSC 314 Computer Graphics
Jan-Apr 2010
Tamara Munzner
http://www.ugrad.cs.ubc.ca/~cs314/Vjan2010
Math Review
Week 1, Wed Jan 6
![Page 2: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/2.jpg)
2
News
• no class this Friday (Jan 8)!
• UBC CS Dept news
![Page 3: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/3.jpg)
3
Department of Computer ScienceUndergraduate Events
Events this weekHow to Prepare for the Tech
Career FairDate: Wed. Jan 6Time: 5 – 6:30 pmLocation: DMP 110
Resume Writing Workshop (for non-coop students)
Date: Thurs. Jan 7Time: 12:30 – 2 pmLocation: DMP 201
CSSS Movie NightDate: Thurs. Jan 7Time: 6 – 10 pmLocation: DMP 310Movies: “Up” & “The Hangover”
(Free Popcorn & Pop)
Drop-In Resume Edition SessionDate: Mon. Jan 11Time: 11 am – 2 pmLocation: Rm 255, ICICS/CS Bldg Industry PanelSpeakers: Managers from Google, IBM,
Microsoft, TELUS, etc.Date: Tues. Jan 12Time: Panel: 5:15 – 6:15 pm;
Networking: 6:15 – 7:15 pmLocation: Panel: DMP 110; Networking:
X-wing Undergrad Lounge Tech Career FairDate: Wed. Jan 13Time: 10 am – 4 pmLocation: SUB Ballroom
![Page 4: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/4.jpg)
4
Review: Computer Graphics Defined
• CG uses• movies, games, art/design, ads, VR,
visualization
• CG state of the art• photorealism achievable (in some cases)
http://www.alias.com/eng/etc/fakeorfoto/quiz.html
![Page 5: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/5.jpg)
5
Review: Rendering Capabilities
www.siggraph.org/education/materials/HyperGraph/shutbug.htm
![Page 6: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/6.jpg)
6
Today’s Readings
• FCG Chapter 2: Miscellaneous Math• except 2.7 (2.11 in 2nd edition)
• FCG Chapter 5: Linear Algebra• except 5.4 (not in 2nd edition)
![Page 7: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/7.jpg)
7
Notation: Scalars, Vectors, Matrices
• scalar• (lower case, italic)
• vector• (lower case, bold)
• matrix• (upper case, bold)
a
[ ]naaa ...21=a
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
=
333231
232221
131211
aaa
aaa
aaa
A
![Page 8: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/8.jpg)
8
Vectors
• arrow: length and direction• oriented segment in nD space
• offset / displacement• location if given origin
![Page 9: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/9.jpg)
9
Column vs. Row Vectors
• row vectors
• column vectors
• switch back and forth with transpose
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
=
n
col
a
a
a
...2
1
a
rowTcol aa =
[ ]nrow aaa ...21=a
![Page 10: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/10.jpg)
10
Vector-Vector Addition
• add: vector + vector = vector• parallelogram rule
• tail to head, complete the triangle
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
+++
=+
33
22
11
vu
vu
vu
vu
)0,6,5()1,1,3()1,5,2(
)6,9()4,6()2,3(
=−+=+
vu +
u
v
geometric algebraic
examples:
![Page 11: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/11.jpg)
11
Vector-Vector Subtraction
• subtract: vector - vector = vector
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
=−
33
22
11
vu
vu
vu
vu
)2,4,1()1,1,3()1,5,2(
)2,3()4,6()2,3(
−=−−−−=−
=−vu
u
v
v−
)( vu −+
![Page 12: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/12.jpg)
12
Vector-Vector Subtraction
• subtract: vector - vector = vector
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
=−
33
22
11
vu
vu
vu
vu
)2,4,1()1,1,3()1,5,2(
)2,3()4,6()2,3(
−=−−−−=−
=−vu
u
v
v−
)( vu −+
vu + v
u uv−v
uargument reversal
![Page 13: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/13.jpg)
13
Scalar-Vector Multiplication
• multiply: scalar * vector = vector• vector is scaled
)*,*,*(* 321 uauauaa =u
)5,.5.2,1()1,5,2(*5.
)4,6()2,3(*2
==
u*a
u
![Page 14: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/14.jpg)
14
Vector-Vector Multiplication
• multiply: vector * vector = scalar• dot product, aka inner product vu •
( ) ( ) ( )332211
3
2
1
3
2
1
vuvuvu
v
v
v
u
u
u
∗+∗+∗=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡•
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
![Page 15: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/15.jpg)
15
Vector-Vector Multiplication
• multiply: vector * vector = scalar• dot product, aka inner product vu •
( ) ( ) ( )332211
3
2
1
3
2
1
vuvuvu
v
v
v
u
u
u
∗+∗+∗=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡•
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡( ) ( ) ( )332211
3
2
1
3
2
1
vuvuvu
v
v
v
u
u
u
∗+∗+∗=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡•
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
![Page 16: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/16.jpg)
16
Vector-Vector Multiplication
• multiply: vector * vector = scalar• dot product, aka inner product
€
u1
u2
u3
⎡
⎣
⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥•
v1
v2
v3
⎡
⎣
⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥= u1∗v1( ) + u2 ∗v2( ) + u3 ∗v3( )
vu •
θcosvuvu =•
u
vθ
• geometric interpretation• lengths, angles• can find angle between two vectors
![Page 17: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/17.jpg)
17
Dot Product Geometry• can find length of projection of u onto v
• as lines become perpendicular,
θcosvuvu =• u
vθ
θcosu0→• vu
v
vuu
•=θcos
![Page 18: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/18.jpg)
18
Dot Product Example
19676)3*2()7*1()1*6(
3
7
1
2
1
6
=++=++=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡•
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
€
u1
u2
u3
⎡
⎣
⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥•
v1
v2
v3
⎡
⎣
⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥= u1∗v1( ) + u2 ∗v2( ) + u3 ∗v3( )
![Page 19: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/19.jpg)
19
Vector-Vector Multiplication, The Sequel
• multiply: vector * vector = vector• cross product
• algebraic
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡×
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
1221
3113
2332
3
2
1
3
2
1
vuvu
vuvu
vuvu
v
v
v
u
u
u
![Page 20: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/20.jpg)
20
Vector-Vector Multiplication, The Sequel
• multiply: vector * vector = vector• cross product
• algebraic
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡×
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
1221
3113
2332
3
2
1
3
2
1
vuvu
vuvu
vuvu
v
v
v
u
u
u
![Page 21: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/21.jpg)
21
Vector-Vector Multiplication, The Sequel
• multiply: vector * vector = vector• cross product
• algebraic
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡×
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
1221
3113
2332
3
2
1
3
2
1
vuvu
vuvu
vuvu
v
v
v
u
u
u
blah blah
3
1
2
![Page 22: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/22.jpg)
22
Vector-Vector Multiplication, The Sequel
• multiply: vector * vector = vector• cross product
• algebraic
• geometric
• parallelogramarea
• perpendicularto parallelogram
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡×
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
1221
3113
2332
3
2
1
3
2
1
vuvu
vuvu
vuvu
v
v
v
u
u
u
ba×
ba×
θsinvuba =×
θ
![Page 23: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/23.jpg)
23
RHS vs. LHS Coordinate Systems
• right-handed coordinate system
• left-handed coordinate system
xy
z
xyz
right hand rule: index finger x, second finger y;right thumb points up
left hand rule: index finger x, second finger y;left thumb points down
yxz ×=
yxz ×=
convention
![Page 24: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/24.jpg)
24
Basis Vectors
• take any two vectors that are linearly independent (nonzero and nonparallel)• can use linear combination of these to define
any other vector:
bac 21 ww +=
![Page 25: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/25.jpg)
25
Orthonormal Basis Vectors
• if basis vectors are orthonormal (orthogonal (mutually perpendicular) and unit length)• we have Cartesian coordinate system
• familiar Pythagorean definition of distance
0
,1
=•
==
yx
yx
orthonormal algebraic properties
![Page 26: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/26.jpg)
26
Basis Vectors and Origins
jiop yx ++=o
p
i
j
• coordinate system: just basis vectors• can only specify offset: vectors
• coordinate frame: basis vectors and origin• can specify location as well as offset: points
![Page 27: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/27.jpg)
27
Working with Frames
pFF11
FF11
i
jo
jiop yx ++=
![Page 28: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/28.jpg)
28
Working with Frames
pFF11
FF11 p = (3,-1)p = (3,-1)
i
jo
jiop yx ++=
![Page 29: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/29.jpg)
29
Working with Frames
pFF11
FF11 p = (3,-1)p = (3,-1)
i
jo
jiop yx ++=
FF11
![Page 30: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/30.jpg)
30
Working with Frames
pFF11
FF11 p = (3,-1)p = (3,-1)
FF22
i
jo
jiop yx ++=
FF22
ijo
![Page 31: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/31.jpg)
31
Working with Frames
pFF11
FF11 p = (3,-1)p = (3,-1)
FF22 p = (-1.5,2)p = (-1.5,2)
i
jo
jiop yx ++=
FF22
ijo
![Page 32: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/32.jpg)
32
Working with Frames
pFF11
FF11 p = (3,-1)p = (3,-1)
FF22 p = (-1.5,2)p = (-1.5,2)
i
j
FF22
ijo
o
jiop yx ++=FF22
![Page 33: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/33.jpg)
33
Working with Frames
pFF11
FF11 p = (3,-1)p = (3,-1)
FF22 p = (-1.5,2)p = (-1.5,2)
FF33
i
j
FF22
ijo
FF33
ijo
o
jiop yx ++=
![Page 34: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/34.jpg)
34
Working with Frames
pFF11
FF11 p = (3,-1)p = (3,-1)
FF22 p = (-1.5,2)p = (-1.5,2)
FF33 p = (1,2)p = (1,2)
i
j
FF22
ijo
FF33
ijo
o
jiop yx ++=
![Page 35: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/35.jpg)
35
Working with Frames
FF11 p = (3,-1)p = (3,-1)
FF22 p = (-1.5,2)p = (-1.5,2)
FF33 p = (1,2)p = (1,2)
pFF11
i
j
FF22
ijo
FF33
ijo
o
jiop yx ++=
FF33
![Page 36: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/36.jpg)
36
Named Coordinate Frames
• origin and basis vectors• pick canonical frame of reference
• then don’t have to store origin, basis vectors• just• convention: Cartesian orthonormal one on
previous slide
• handy to specify others as needed• airplane nose, looking over your shoulder, ...• really common ones given names in CG
• object, world, camera, screen, ...
),,( cba=p
zyxop cba +++=
![Page 37: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/37.jpg)
37
Lines
• slope-intercept form• y = mx + b
• implicit form• y – mx – b = 0
• Ax + By + C = 0
• f(x,y) = 0
![Page 38: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/38.jpg)
38
Implicit Functions
• find where function is 0• plug in (x,y), check if
• 0: on line• < 0: inside• > 0: outside
• analogy: terrain• sea level: f=0• altitude: function value• topo map: equal-value
contours (level sets)
![Page 39: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/39.jpg)
39
Implicit Circles•
• circle is points (x,y) where f(x,y) = 0
• • points p on circle have property that vector from c to p
dotted with itself has value r2
• • points points p on the circle have property that
squared distance from c to p is r2
• • points p on circle are those a distance r from center
point c
222 )()(),( ryyxxyxf cc −−+−=
0)()(:),(),,( 2 =−−•−== ryxcyxp cc cpcp
022 =−− rcp
0=−− rcp
![Page 40: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/40.jpg)
40
Parametric Curves
• parameter: index that changes continuously• (x,y): point on curve
• t: parameter
• vector form•
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡)(
)(
th
tg
y
x
)(tf=p
![Page 41: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/41.jpg)
41
2D Parametric Lines
•
• •
• start at point p0,
go towards p1,according to parameter t
• p(0) = p0, p(1) = p1
€
x
y
⎡
⎣ ⎢
⎤
⎦ ⎥=x0 + t(x1 − x0)
y0 + t(y1 − y0)
⎡
⎣ ⎢
⎤
⎦ ⎥
)()( 010 pppp −+= tt)()( dop tt +=
![Page 42: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/42.jpg)
42
Linear Interpolation
• parametric line is example of general concept•
• interpolation• p goes through a at t = 0• p goes through b at t = 1
• linear• weights t, (1-t) are linear polynomials in t
)()( 010 pppp −+= tt
![Page 43: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/43.jpg)
43
Matrix-Matrix Addition
• add: matrix + matrix = matrix
• example
⎥⎦
⎤⎢⎣
⎡++++
=⎥⎦
⎤⎢⎣
⎡+⎥
⎦
⎤⎢⎣
⎡
22222121
12121111
2221
1211
2221
1211
mnmn
mnmn
nn
nn
mm
mm
⎥⎦
⎤⎢⎣
⎡−=⎥
⎦
⎤⎢⎣
⎡+++−+
=⎥⎦
⎤⎢⎣
⎡−+⎥
⎦
⎤⎢⎣
⎡59
81
1472
53)2(1
17
52
42
31
![Page 44: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/44.jpg)
44
Scalar-Matrix Multiplication
• multiply: scalar * matrix = matrix
• example
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡
2221
1211
2221
1211
**
**
mama
mama
mm
mma
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡153
126
5*31*3
4*32*3
51
423
![Page 45: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/45.jpg)
45
Matrix-Matrix Multiplication
• can only multiply (n,k) by (k,m):number of left cols = number of right rows• legal
• undefined⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
⎥⎦
⎤⎢⎣
⎡
ml
kj
ih
gfe
cba
⎥⎦
⎤⎢⎣
⎡
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
kj
ih
q
g
p
f
o
e
cba
![Page 46: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/46.jpg)
46
Matrix-Matrix Multiplication
• row by column
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡⎥⎦
⎤⎢⎣
⎡
2221
1211
2221
1211
2221
1211
pp
pp
nn
nn
mm
mm
2112111111 nmnmp +=
![Page 47: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/47.jpg)
47
Matrix-Matrix Multiplication
• row by column
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡⎥⎦
⎤⎢⎣
⎡
2221
1211
2221
1211
2221
1211
pp
pp
nn
nn
mm
mm
2112111111 nmnmp +=
2122112121 nmnmp +=
![Page 48: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/48.jpg)
48
Matrix-Matrix Multiplication
• row by column
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡⎥⎦
⎤⎢⎣
⎡
2221
1211
2221
1211
2221
1211
pp
pp
nn
nn
mm
mm
2112111111 nmnmp +=
2212121112 nmnmp +=2122112121 nmnmp +=
![Page 49: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/49.jpg)
49
Matrix-Matrix Multiplication
• row by column
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡⎥⎦
⎤⎢⎣
⎡
2221
1211
2221
1211
2221
1211
pp
pp
nn
nn
mm
mm
2112111111 nmnmp +=
2212121112 nmnmp +=2122112121 nmnmp +=
2222122122 nmnmp +=
![Page 50: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/50.jpg)
50
Matrix-Matrix Multiplication
• row by column
• noncommutative: AB != BA
⎥⎦
⎤⎢⎣
⎡=⎥
⎦
⎤⎢⎣
⎡⎥⎦
⎤⎢⎣
⎡
2221
1211
2221
1211
2221
1211
pp
pp
nn
nn
mm
mm
2112111111 nmnmp +=
2212121112 nmnmp +=2122112121 nmnmp +=
2222122122 nmnmp +=
![Page 51: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/51.jpg)
51
Matrix-Vector Multiplication• points as column vectors: postmultiply
• points as row vectors: premultiply
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢
⎣
⎡
=
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
h
z
y
x
mmmm
mmmm
mmmm
mmmm
h
z
y
x
44434241
34333231
24232221
14131211
'
'
'
'
Mpp'=
[ ] [ ]
T
mmmm
mmmm
mmmm
mmmm
hzyxhzyx
⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢
⎣
⎡
=
44434241
34333231
24232221
14131211
''''TTT Mpp' =
![Page 52: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/52.jpg)
52
Matrices
• transpose
• identity
• inverse• not all matrices are invertible
⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢
⎣
⎡
=
⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢
⎣
⎡
44342414
43332313
42322212
41312111
44434241
34333231
24232221
14131211
mmmm
mmmm
mmmm
mmmmT
mmmm
mmmm
mmmm
mmmm
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
1000
0100
0010
0001
IAA =−1
![Page 53: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/53.jpg)
53
Matrices and Linear Systems
• linear system of n equations, n unknowns
• matrix form Ax=b
125
1342
4273
=++−=−−
=++
zyxzyxzyx
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡−=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡−−
1
1
4
125
342
273
z
y
x
![Page 54: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/54.jpg)
54
Readings for Next Time
• Mon Jan 11• RB Chap Introduction to OpenGL• RB Chap State Management and Drawing
Geometric Objects• RB App Basics of GLUT (Aux in v 1.1)
• RB = Red Book = OpenGL Programming Guide
• http://fly.cc.fer.hr/~unreal/theredbook/
![Page 55: Math Review Week 1, Wed Jan 6](https://reader036.vdocuments.site/reader036/viewer/2022081506/56813d0f550346895da6c77d/html5/thumbnails/55.jpg)
55
Re-Reminder
• no class this Friday (Jan 8)!