Beruflich Dokumente
Kultur Dokumente
Points
y y1 P1 x1 x
O z1 z
Directions
y y1 P1 x1 P2
From P1 towards P2
v x
P1 ( x1 , y1 , z1 ), P2 ( x2 , y 2 , z 2 ) vector v = ( x2 x1 , y 2 y1 , z 2 z1 ) length l = ( x2 x1 ) 2 + ( y2 y1 ) 2 + ( z 2 z1 ) 2 normalized vector ( x2 x1 y 2 y1 z 2 z1 , , ) l l l
3
O z1 z
Vector operations
Dot product
result is a scalar (one number) cosine of the angle between the vectors times the product of the lengths of the vectors if unit length vectors, dot product is cosine of angle between the two directions commutative
( x1 , y1 , z1 ) ( x2 , y2 , z 2 ) = x1 x2 + y1 y2 + z1 z2 ( x1 , y1 , z1 ) ( x2 , y2 , z 2 ) = x1 + y1 + z1
2 2 2
x2 + y2 + z2 cos 4
2 2 2
Vector operations
Cross-product
result is a vector
perpendicular to both operands length is lengths times sine of angle
v1 x v2
v2 x v1 v1
v2
( x1 , y1 , z1 ) ( x2 , y2 , z 2 ) = ( y1 z 2 z1 y2 , z1 x2 x1 z 2 , x1 y2 y1 x2 ) v1 v2 = v1 v2 sin v1 v2 = v2 v1
5
Geometry
Line
y y1 P1 x1 P2
O z1 z
P0 O z x
P0 ( x0 , y0 , z0 ), n( n x , n y , n z ) plane n x ( x x0 ) + n y ( y y 0 ) + n z ( z z 0 ) = 0 ( P P0 )n = 0
Planes (3 points)
y P0 P1 O z n
P0 ( x0 , y0 , z0 ), P1 ( x1 , y1 , z1 ), P0 ( x2 , y 2 , z 2 )
P2 x
normal n = ( P1 P0 ) ( P2 P0 ) plane ( P P0 )n = 0
Triangles (3 points)
y P0 P1 O z n
P0 ( x0 , y0 , z0 ), P ( x1 , y1 , z1 ), P2 ( x2 , y2 , z2 ) 1 normal n = ( P P0 ) ( P2 P0 ) 1
P2 x
10
Transformations
11
Translations
Points
P1(x1, y1, z1) moves to P2(x2, y2, z2) translation amount (x2-x1, y2-y1, z2-z1)
12
Rotations
y y1 = y2 P O z2 z1 z
13
x1 x2
Positive rotations
Convention
in right-handed coordinate systems look down axis to rotate about (towards origin) counterclockwise rotation transforms one positive axis into the other
y >0 z O x
14
Rotations
y y1 = y2 P O z2 z1 z P x1 x2 x
Matrix notation
Rotation about y axis
cos 0 sin 0 sin x1 x1 cos + z1 sin 1 0 y1 = y1 z1 x1 sin + z1 cos 0 cos
16
Scaling
y P1 P2 O P2 x P1
Combinations of xforms
A chain of transformations
matrices are multiplied matrix multiplication is associative matrix multiplication is NOT commutative equivalent matrix
Combinations of xforms
r11 r 21 r31 0
2
t14 t 24 t34 1
2
Rigid body
any combination of rotations and translations R (r11, , r33) is orthographic
columns (and lines) are mutually perpendicular unit vectors
(r11 , r21 , r31 ) (r12 , r22 , r32 ) = 0 (r12 , r22 , r32 ) (r13 , r23 , r33 ) = 0 (r13 , r23 , r33 ) (r11 , r21 , r31 ) = 0
Combinations of xforms
Affine transform
r11 r 21 r31 0 r12 r22 r32 0 r13 t14 r23 t 24 r33 t34 0 1
any combination of rotations, translations and scalings does not preserve angles and lengths does preserve parallelism of lines
20
10
Given
y O z x O x P point P(x, y,z) new coordinate system
unit vectors x, y, z origin O
21
Pt = P O'
22
11
y O z
P, P
x O x
24
12
25
Step 1
Create new coordinate system with origin Oa and a as one of its axes
using axis x(1, 0, 0) set b = (x x a); normalize b set c = a x b; normalize c (Oa, a, b, c) is a new coordinate system
note: one needs to make sure that the auxiliary axis (in this case x) is not aligned with a; one solution is to consider x and y and pick the one that has the smaller dot product with a (ignoring the sign) since that axis is closer to being perpendicular to a.
26
13
Steps 2-4
Step 2: Transform P to the new coordinate system, P->P Step 3: Rotate about a (first axis), P->P Step 4: Transform back to original coordinate system, P->Pr
27
14