Multiplication M1 v1 = v2 4 0 3 -2 4.-2 + 0.2 + 3.4 4 1 -1 7 2 = 1.-2 + -1.2 + 7.4 = 24 -3 3 2 4...

Preview:

Citation preview

Multiplication M1 v1 = v2

4 0 3 -2 4.-2 + 0.2 + 3.4 4 1 -1 7 2 = 1.-2 + -1.2 + 7.4 = 24-3 3 2 4 -3.-2 + 3.2 + 2.4 20

M1 M2 = M3

4 0 3 -2 3 1 4 12 25 1 -1 7 2 -3 -5 = 24 6 55 -3 3 2 4 0 7 8 -18 -4

v3 M2 = v4

-2 3 1 1 -1 7 2 -3 -5 = 24 6 55 4 0 7

Gauss-Jordan

x + y + -z = 7-x + 2y + -z = -5 -y + 2z = 8

1 1 –1 x 1 0 0 7-1 2 -1 y = 0 1 0 -5 0 -1 2 z 0 0 1 8

x + y + -z = 7 3y + -2z = 2 -y + 2z = 8

1 1 –1 x 1 0 0 7 0 3 -2 y = 1 1 0 -5 0 -1 2 z 0 0 1 8

x = .. y = .. z = ..

1 0 0 x 3/4 1/2 1/4 70 1 0 y = 1/2 1 1/2 -50 0 1 z 1/4 1/2 3/4 8

Projection

x

y

z

Line: lineVec == supportVecLine + a * directionVecLinePlane: planeVec == supVecPlane + b * dirVec1Plane + c * dirVec2Plane

Intersection: lineVec == planeVec ==> supportVecLine + a * directionVecLine == supVecPlane + b * dirVec1Plane + c * dirVec2Plane

In figure: eyeVec + a * (starVec – eyeVec) == b* (0 1 0) + c* (0 0 1) (3 equations, 3 unknowns)

Rotation around origin

ab

r cos a cos b

r cos b

r sin b

a

r cos a sin b

r sin a cos b

x r cos a Rotation Rb in x y plane: y r sin a x’ r cos a cos b - r sin a sin b x cos b - y sin b cos b -sin b x y’ r cos a sin b + r sin a cos b x sin b + y cos b sin b cos b y

r

x’y’

xy

r sin a

r cos a

r sin a sin b

=

= = =

Generalized in 3 planes: 1 0 0Rxu = 0 cos u -sin u 0 sin u cos u

cos v 0 sin vRyv = 0 1 0 -sin v 0 cos v

cos w –sin w 0 xRzw = sin w cos w 0 y 0 0 1 z

Multiply matrices to compose: vRotated = (Rzw Ryv Rxu) vOriginal

Scaling with respect to origin

x’ Sx 0 0 x y’ = 0 Sy 0 y z’ 0 0 Sz z

Translation

x’ 1 0 0 Tx x y’ 0 1 0 Ty y z’ 0 0 1 Tz z 1 0 0 0 1 1

=

x’ x Tx y’ y + Ty z’ z Tz

=

As addition:

As multiplication (homogenisation, needed for composition):

CompositionPrinciple

To compose transformations:- Homogenize transformation matrices and vectors- Multiply matrices to get composite matrix- Multiply composite matrix by vector to apply all transformations at once

Example

Rotation around an arbitrary point with homogenized matrices:-Translation to origin: Mt-Rotation around origin: Mr-Translation back: inverse of Mt is Mti-Composed transformation matrix: Mc = Mti Mr Mt-To transform any vector: v’ = Mc v

Homogenization makes it possible to compose an arbitrary number of transformations into one transformation matrix. This saves lots of time if there are many vectors to transform, which is typically the case.

Recommended