Math Review
Intro to Computer Graphics
© 2020 Enrique Rosales
Learning goals
© 2020 Enrique Rosales
Intro to Computer Graphics
• Vectors
• Dot product
• Cross product
• Difference between vectors and points
• Bivectors
• Trivectors
• Matrices
• Coding example
Notation
© 2020 Enrique Rosales
Intro to Computer Graphics
Real-time rendering by Tomas Akenine-Moller [et. al.] page 5
What is a Vector?
© 2020 Enrique Rosales
Intro to Computer Graphics
It depends of who is asking
© 2020 Enrique Rosales
Intro to Computer Graphics
What is a Vector?It depends of who is asking
© 2020 Enrique Rosales
Intro to Computer Graphics
• Programming
• Mathematical
• Geometric
Programming perspective
© 2020 Enrique Rosales
Intro to Computer Graphics
Data
It is a n-tuple of real numbers
𝑎 = 𝑎1, 𝑎2, … , 𝑎𝑛
Mathematical perspective
© 2020 Enrique Rosales
Intro to Computer Graphics
This data is a matrix
𝑎𝑇 = 𝑎𝑥 , 𝑎𝑦 , 𝑎𝑧𝑎 =
𝑎𝑥𝑎𝑦𝑎𝑧
Geometric perspective
© 2020 Enrique Rosales
Intro to Computer Graphics
Geometric interpretationLinear Algebra
© 2020 Enrique Rosales
Intro to Computer Graphics
• Position
• Vector (a direction with a magnitude)
Geometric interpretationGeometric Algebra
© 2020 Enrique Rosales
Intro to Computer Graphics
• Position
• Vector (Directed length)
• Bivector (Directed area)
• Trivector (Directed volume)
Dot Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Measures the similarity of two vectors
𝑎𝑏 =
𝑖=1
𝑛
𝑎𝑖𝑏𝑖
Dot Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Measures the similarity of two vectors
𝑎𝑏 =
𝑖=1
𝑛
𝑎𝑖𝑏𝑖
𝑎𝑏 = 𝑎𝑥𝑏𝑥 + 𝑎𝑦𝑏𝑦 + 𝑎𝑧𝑏𝑧
Cross Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Measures the difference of two vectors
𝑎 × 𝑏 = 𝑎𝑦𝑏𝑧 − 𝑎𝑧𝑏𝑦 , 𝑎𝑧𝑏𝑥 − 𝑎𝑥𝑏𝑧, 𝑎𝑥𝑏𝑦 − 𝑎𝑦𝑏𝑥
𝑎
𝑏𝑑
Cross Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Cross Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Cross Product
© 2020 Enrique Rosales
Intro to Computer Graphics
© 2020 Enrique Rosales
Intro to Computer Graphics
Wedge Product
Bivector
(directed area)
(Geometric Algebra)
𝑎𝑏 = 𝑎𝑦𝑏𝑧 − 𝑎𝑧𝑏𝑦 , 𝑎𝑧𝑏𝑥 − 𝑎𝑥𝑏𝑧, 𝑎𝑥𝑏𝑦 − 𝑎𝑦𝑏𝑥
Cross Product / Wedge Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Bivector
Wedge Product
© 2020 Enrique Rosales
Intro to Computer Graphics
𝑎
𝑏𝑐
𝑎𝑏𝑐
(Geometric Algebra)
Wedge Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Trivector
(directed volume)
𝑎
𝑏
𝑐𝑎𝑏𝑐
(Geometric Algebra)
Wedge Product
© 2020 Enrique Rosales
Intro to Computer Graphics
Trivector
(directed volume)
𝑎𝑏𝑐
(Geometric Algebra)
Colum vectors or Row vectors?
© 2020 Enrique Rosales
Intro to Computer Graphics
𝑎𝑇 = 𝑎𝑥 , 𝑎𝑦 , 𝑎𝑧𝑎 =
𝑎𝑥𝑎𝑦𝑎𝑧
Chapters 4 and 5 (Vectors)
Chapter 7 (Matrices)
3D math primer for graphics and game development by Fletcher Dunn, Ian Parberry
Thanks
Enrique Rosales