155 views

Uploaded by s

Math Cheat Sheet for programmers and game designers

- 18_032006L08
- matrices_0.pdf
- hw1s
- 50263
- Solution to Simultaneous or Higher Order Using Matlab
- Notes Section 1 Linear Algebra
- Untitled
- Math for Intro Physics.a4
- Hw 2 Solutions
- flint-2.3.pdf
- Lecture 7 - Matrices
- k (2)
- IFEM.Ch03
- class XII
- Biosim3 Linear Algebra
- rpt
- Matrix Primer
- OPTIMIZACION
- Electromagnetic Fields and Waves - Magdy F. Iskander - Text.pdf
- Linear Algebra Cheatsheet

You are on page 1of 1

Vectors

Matrix * Matrix

Each cell (row, col) in AB is:

P

n

Wherehn is dimensionality

ih

iof matrix.

h

i

a b

e f

ae + bg af + bh

AB =

=

c d

g h

ce + dg cf + dh

i=1

Vector Addition

The sum of 2 vectors completes the triangle.

1

0

0

0

also a = c b and b = c a

Used to represent a direction or normal. Length of 1.

~

= A

A

~

||A||

~

Where ||A||

Can be used

Pn to get the angle between 2 vectors.

~B

~ =

A

A B = A1 B1 + A2 B2 + + An Bn

i=1 i i

B)

= arccos(

~ B

~

A

~

~ )

||A||||

B||

Produces a vector perpendicular to the plane containing the 2

vectors.

Matrix Determinant

For a 2x2 or 3x3 matrix use the Rule of Sarrus; add products of

top-left to bottom-right diagonals, subtract products of opposite

diagonals.

#

"

a b c

d e f

Its determinant |M | is:

M =

g h i

|M | = aei + bf g + cdh ceg bdi af h

For 4x4 use Laplace Expansion; each top-row value * the 3x3 matrix

made of all other rows and columns:

|M | = aM1 bM2 + cM3 dM4

See http://www.euclideanspace.com/maths/algebra/matrix/

functions/determinant/fourD/index.htm

Matrix Transpose

Flip matrix over its main diagonal. In special case of orthonormal

xyz matrix then inverse is the transpose. Can use to switch

between

" row-major

# and column-major

"

# matrices.

a b c

a d g

d e f

b e h

M =

MT =

g h i

c f i

"

"

"

a1

b1

a2 b3 a3 b2

a2

b2

a3 b1 a1 b3

=

a3

b3

a1 b2 a2 b1

To compute surface normals from 2 edges:

N = normalize (cross (A, B));

Matrices

Identity Matrix

All 0,"except the top-left

to bottom-right diagonal.

#

1 0 0

0 1 0

I3 =

0 0 1

if AB = I then A is the inverse of B and vice versa.

Matrix

* Vector

"

#" #

a

d

g

b

e

h

c

f

i

x

y

z

"

=

ax + by + cz

dx + ey + f z

gx + hy + iz

Commonly

used in OpenGLmaths

libraries

Vx

Xx Yx Zx Tx

Xy Yy Zy Ty Vy

v0 =

Vz

Xz Yz Zz Tz

1

0

0

0

1

Matrix Inverse

Use an inverse matrix to reverse its transformation, or to

transform relative to another object.

M M 1 = I Where I is the identity matrix.

If the determinant of a matrix is 0, then there is no inverse. The

inverse can be found by multiplying the determinant with a large

matrix of cofactors. For the long formula see

http://www.cg.info.hiroshima-cu.ac.jp/~miyazaki/

knowledge/teche23.html

Use the transpose of an inverse model matrix to transform

normals: n0 = n(M 1 )T

Homogeneous Matrices

Row-Order Homogeneous Matrix

Commonly used in Direct3D

maths libraries

Xx Xy Xz 0

Yx Y y Yz 0

0

v = Vx Vy Vz 1

Zx Zy Zz 0

Tx

Ty

Tz 1

0 0

1 0

column order T =

0 1

0 0

1

0

0

0 cos() sin()

Rx =

0 sin()

cos()

0

0

0

cos()

0 sin()

0

1

0

Ry =

sin() 0 cos()

0

0

0

cos() sin() 0

sin()

cos()

0

Rz =

0

0

1

0

0

0

View Matrix

Sx

0

Tx

0

Sy

Ty

S=

0

0

Tz

0

0

1

0

0

(column-order)

0

1

0

0

(column-order)

0

1

0

0

(column-order)

0

1

0

0

Sz

0

0

0

0

1

Rx

Ry

Rz

Px

Ux

Uy

Uz

Py

(column-order)

V =

Fx Fy Fz Pz

0

0

0

1

Where U is a vector pointing up, F forward, and P is world position

of camera.

1 0

0

0

0 0 1 0

Birds-eye view V =

0 1

0

0

0 0

0

1

Projection Matrix

Sx

0

0

0

0

Sy

0

0

P =

(column-order)

0

0

Sz Pz

0

0

1

0

Sx = (2 near)/(range aspect + range aspect)

Sy = near/range

Sz = (f ar + near)/(f ar near)

Pz = (2 f ar near)/(f ar near)

range = tan(f ov/2) near

revision 4. 5 Oct 2012

Dr Anton Gerdelan, apg@scss.tcd.ie, Trinity College Dublin, Ireland.

LATEX template from http://www.stdout.org/winston/latex/

Thanks Micha

el, Amoss, and Veronica!

- 18_032006L08Uploaded byIgor Campos
- matrices_0.pdfUploaded bychessgeneral
- hw1sUploaded byGunvir Singh
- 50263Uploaded bymarudev nathawat
- Solution to Simultaneous or Higher Order Using MatlabUploaded byDayang Norashikin
- Notes Section 1 Linear AlgebraUploaded byagonza70
- UntitledUploaded byapi-139761950
- Math for Intro Physics.a4Uploaded bysherrytangy
- Hw 2 SolutionsUploaded byssriraghav
- flint-2.3.pdfUploaded byGNZL
- Lecture 7 - MatricesUploaded byaef
- k (2)Uploaded byAlireza Intel
- IFEM.Ch03Uploaded byChandan Chidanand
- class XIIUploaded byVivek
- Biosim3 Linear AlgebraUploaded byAditi Gupta
- rptUploaded byMOHD ADIB ADWA BIN AB KARIM -
- Matrix PrimerUploaded bymir emmett
- OPTIMIZACIONUploaded byBryam Deyvi Minchola Ipanaque
- Electromagnetic Fields and Waves - Magdy F. Iskander - Text.pdfUploaded byandrik supa
- Linear Algebra CheatsheetUploaded byAbdul Alhazred
- Field Theory Ch1Uploaded bypra_zara2637
- On JAM of Triangular Fuzzy Number MatricesUploaded byijsret
- A Behavioral Approach to Estimation and Dead-beatUploaded byArulraj
- Matrices and DeterminantsUploaded byAnonymous G4VuCb
- 519502.prezentacija_webminingUploaded byMarkus Schatten
- ES21_DeterminantsAndMatricesUploaded byLih Medrano
- 4.3 Partitioned.pdfUploaded byjulianli0220
- 1st Year B.tech Syllabus Revised 18.08.10Uploaded byPriyanka Basu
- CSE 222Uploaded byGauravBudania
- Lecture - 2Uploaded byAhmad Soban

- MSc Chemistry-Syllabus JhansiUploaded byOmSilence2651
- Propiedades Extremas de Valores Propios TropicalesUploaded byWendy Villogas Espinoza
- Themes10 Centrality DoubleColUploaded byUsman Ilyas
- Coursera, Everything is the Same - Lecture 11Uploaded byJoanne
- An Introduction to RUploaded bymartinweingart
- 6114 Weight Normalization a Simple Reparameterization to Accelerate Training of Deep Neural NetworksUploaded byJose Miguel Alves
- Tradeoff Constellation Transceiver MIMOUploaded byfiringblaze420
- Quantitative Strategic Planning MatrixUploaded bykripa dudu
- Barry Wilkinson, Michael Allen-Parallel Programming_ Techniques and Applications Using Networked Workstations and Parallel Computers (2nd Edition) -Prentice Hall (2004)Uploaded byKusum0
- Dimensionality Reduction Techniques for Document Clustering- A SurveyUploaded byijtetjournal
- BCEE 452 ENGR 6511- Course OutlineUploaded byDaniel
- Course Contents BS(Hons)Uploaded bywahabmaths
- Villanueva.advmathUploaded byMeggy Villanueva
- Mirowsky (1991) Postmodernism and the Social Theory of ValueUploaded bysashadam815812
- VIM.pdfUploaded byazsxdc_azsxdc
- LinestUploaded bycharu555
- Coupled Flexural - Torsional Vibration and Stability Analysis of Pre-loaded Beams Using Conventional and Dynamic Finite Element MethodsUploaded byNadia Balqis
- Mathematics Important Results and Formulae Chapter - i Applications OfUploaded byJamie Singleton
- Pseudo InverseUploaded bycmtinv
- Notes 4.3 and 4.4Uploaded byAntoni Xu
- LabVIEW IntroUploaded byja2345
- 2015 Free Vibration OjhaUploaded byAnil Mali
- Ahem and Harford-The Importance of Industry Links in Merger WavesUploaded byMarat Səfərli
- HP 50g Graphing Calculator - DataShetUploaded bylaurad053887
- AFIT-GAE-ENY-04-J12Uploaded bybmccune7187
- Improved Total Least Squares Estimators for Modal AnalysisUploaded byIgnacio Daniel Tomasov Silva
- Jongman 1995 Data AnalysisUploaded byAdane Girma
- A stateoftheartinstructuredlightpatternsforsurfaceprofilometry.pdfUploaded byKhaled Waly Ahlawy
- 03.Geo InforUploaded byDeiva Sigamani
- Efficient Incremental Fuzzy Logic ControllerUploaded byVijaya Chintala