University of California, Berkeley
EECS Dept, CS Division
Jordan Smith SLIDE: Scene Language for
Interactive Dynamic Environments
Prof. Carlo H. Séquin

Home Goals Publications People Gallery Assignments Distributions

SLIDE 2D Linear Algebra Notes

  1. Vector Spaces and Affine Spaces
  2. Transformations in 2D

    1. Translation
    2. Rotation
    3. Scale
    4. Viewport

  3. Matrix Properties


Vector Spaces and Affine Spaces

Read Foley et.al. Appendix A.1

A vector space is a set of vectors which have a vector addition (u+v) and a scalar multiplication (cv). The vector spaces we will use most commonly in graphics are R2 and R3, the 2D and 3D real coordinate systems.

For our purposes, an affine space a vector space offset from the origin.

We can represent points and vectors in an affine space by adding an extra coordinate. For points, this coordinate will be 1, for vectors it will be 0. So, in 2D the point, p at (1,1) will be written p=(1,1,1), but the vector v at (1,1) will be written v=(1,1,0).

You can visualize the 2D affine space as the w=1 plane in a 3-dimensional (x,y,w) space.

You can subtract points to get vectors (p1-p2=u), and you can add vectors to points to get other points (p1+u=p2), but you cannot add two points together in an affine space. (p1+p2 is outside the affine plane),



Transformations in 2D

Type Column Vector Matrix Row Vector Matrix Properties
Rotation
rotate (0 0 1) (a)
cos(a)-sin(a)00
sin(a)cos(a)00
0010
0001
cos(a)sin(a)00
-sin(a)cos(a)00
0010
0001
Rigid Body
Orthogonal
Scale

scale (sx sy 1)
sx000
0sy00
0010
0001
sx000
0sy00
0010
0001
Non-Rigid (does not preserve length/volume)
Translation

translate (tx ty 0)
100tx
010ty
0010
0001
1000
0100
0010
txty01
Rigid Body
Orthogonal Submatrix

Translation

x' = x + tx
y' = y + ty
Translation can be written as a shear in an affine space.

Rotation


Rotation can be thought of as representing a rotated coordinate system's basis vectors in a current coordinate system. Based on this mental approach, a rotation can be thought of as a change of basis matrix. Usually this change of basis is done with unit length basis vectors, in which case the rotation matrix is then orthogonal.

In the figure on the right, the point p is rotated by an angle a to the point p'. You could think of the same transformation as rotating the x-axis to x' and the y-axis to y'. Then the point p is in the correct rotated place with respect to x' and y'.

Scale

Uniform scale:
p'=sp
Non-uniform scale:
x' = sxx
y' = syy

View Port

World Window = ( (xmin, ymin), (xmax, ymax) )
View Port = ( (umin, vmin), (umax, vmax) )


MVP,W = T(umin, vmin) * S( (umax - umin)/(xmax - xmin), (vmax - vmin)/(ymax - ymin) ) * T(-xmin, -ymin)


Matrix Properties

Transpose
(QR)T = RTQT
Inverse
Q Q-1 = I
(QR)-1 = R-1Q-1
Symmetric
Q = QT
Orthogonal
(QQT) = I
QT = Q-1
All of the columns of an orthogonal matrix are orthonormal. This means that In other words, for Q = qi j with rows Ri = qi * and columns Cj = q* j, then for all i and j



This page was originally built by Jordan Smith.

Last modified: Sunday, 08-Sep-2002 19:33:33 PDT