Spatial Descriptions and Transformations Sebastian van Delden USC Upstate
Notation… Lowercase variables are scalars Uppercase variables are vectors or matrices Leading sub- and super-scripts: identify which coordinate system a quantity is defined in: A P A position vector in system {A} Rotation matrix that rotates from system {B} into system {A} Trailing superscript: inverse A -1 or transpose A T Trailing subscript: vector component (X A ) or description ( A P BORIG ) Given angle θ 1 : cos θ 1 == cθ 1 == c 1
Position Vectors A 3x1 vector Leading superscript indicates referenced coordinate system.
Orientation In which direction is the point pointing… Attach a coordinate system to the point and describe it relative to a reference system.
Orientation cont… Write unit vectors of {B}’s three principle axes in terms of coordinate system {A}: A X B, A Y B, A Z B Can be stacked in a 3x3 matrix called a rotation matrix: = [ A X B A Y B A Z B ] = = The r ij values are projections of {B}’s unit vectors onto the unit vectors of {A}.
Orientation cont… Recall dot product... Consider unit vector A and B: B. A T = is the projection of B onto A. Also called a “directional cosine”. Angle between vectors: cos -1 (.707) = 45 o
Orientation cont… = [ A X B A Y B A Z B ] = = or = = [ A X B A Y B A Z B ] = I 3 So, the inverse a rotation matrix is simple the transpose of that matrix. For any matrix with orthogonal columns, its inverse is equal to its transpose.
Orientation cont… Example:
“Frames” A Frame Contains information about position and orientation of a location 4 vectors: 3 for orientation, 1 for position For example, frame {B} can be defined in frame {A} as: {B} = {, A P BORG }
Mappings Need to express one coordinate system in terms of another. Changing the description (position and orientation) from one frame to another is called a mapping.
Mappings: Pure Translations If the two frames different by only a position vector (orientation is the same) then only a translation is needed. A P = B P + A P BORG
Mappings: Pure Translations cont…
Mappings: Pure Rotations A 3x3 matrix Columns have unit magnitude Columns are {B} written in {A} Rows are {A} written in {B} Multiple the rotation matrix and the point together: A P x = B X A. B P A P y = B Y A. B P A P z = B Z A. B P A P = B P
Mappings: Pure Rotations cont… Example: Pure rotation around Z
Mappings: Pure Rotations cont…
General Mappings The two frames differ by both a translation and rotation. A P = B P + A P BORG Example: A point B P is located at position [2 1 0] T in {B}. Frame {B} is rotated relative to frame {A} by 60 o around the Z axis. Frame {B}’s origin is translated by [3 4 0] T. What are the coordinates of the point A P in frame {A}.
Homogeneous Transformation Matrix A better way to represent general transformations. The rotation and translation is combined into a single 4x4 matrix.
Homogeneous Transformation Matrices cont… A 4x4 matrix is better for writing compact equations. The bottom row is always [ ] These values can be modified to represent scaling and perspective factors. Homogeneous transformations are used to represent a coordinate system or a movement.
Homogeneous Transformations cont… Pure Translation Transformations Pure Rotation Transformations
Compound Transformations Multiple transforms are simple multiple together: A P = C P
Inverse of a Homogenous Transform Given need to find : Need to find and B P AORG from and A P BORG Rotation Part: = T Translation Part: B ( A P BORG ) = A P BORG + B P AORG 0 = A P BORG + B P AORG B P AORG = - T A P BORG
Inverse of a Homogenous Transform Visualize Translation: So: