350 likes | 939 Vues
Spatial Descriptions and Transformations. Sebastian van Delden USC Upstate svandelden@uscupstate.edu. 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
E N D
Spatial Descriptions and Transformations Sebastian van Delden USC Upstate svandelden@uscupstate.edu
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: • AP • A position vector in system {A} • Rotation matrix that rotates from system {B} into system {A} • Trailing superscript: inverse A-1 or transpose AT • Trailing subscript: vector component (XA) or description (APBORIG) • Given angle θ1: cos θ1 == cθ1 == c1
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}: • AXB, AYB, AZB • Can be stacked in a 3x3 matrix called a rotation matrix: • = [AXBAYBAZB] = = • The rij 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 . AT = .707 • .707 is the projection of B onto A. • Also called a “directional cosine”. • Angle between vectors: cos-1(.707) = 45o
Orientation cont… = [AXBAYBAZB] = = or = = [AXBAYBAZB] = I3 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} = { , APBORG}
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. • AP = BP + APBORG
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: APx = BXA . BP APy = BYA . BP APz = BZA . BP AP = BP
Mappings: Pure Rotations cont… • Example: Pure rotation around Z
General Mappings • The two frames differ by both a translation and rotation. • AP = BP + APBORG • Example: • A point BP is located at position [2 1 0]T in {B}. • Frame {B} is rotated relative to frame {A} by 60o around the Z axis. • Frame {B}’s origin is translated by [3 4 0]T. • What are the coordinates of the point AP 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 [0 0 0 1] • 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: • AP = CP
Inverse of a Homogenous Transform • Given need to find : • Need to find and BPAORG from and APBORG • Rotation Part: • = T • Translation Part: • B(APBORG) = APBORG + BPAORG • 0 = APBORG + BPAORG • BPAORG = - T APBORG
Inverse of a Homogenous Transform • Visualize Translation: • So: