CSC 418: Geometric Transformations 1 Tutorial Solutions


  1. rot(z,th1)rot(z,th2) =
    [ c1 -s1 0 0 ] [ c2 -s2 0 0 ]
    [ s1  c1 0 0 ] [ s2  c2 0 0 ]
    [  0   0 1 0 ] [  0   0 1 0 ]
    [  0   0 0 1 ] [  0   0 0 1 ]
    
    = [ c1c2-s1s2  -c1s2-s1c2 0 0 ]
      [ s1s2+c1c2  -s1s2+c1c2 0 0 ]
      [     0           0     1 0 ]
      [     0           0     0 1 ]
    
    =rot(z,th1+th2)
    


  2. We need to find the transformations to apply to CS_eye that would align it with CS_block. One solution is thus:

    rot(y,90) trans(0,1,0) rot(z,71) trans(-2,0,0)
    rot(z,-71) trans(0,-1,0) trans(2.8,0,0) trans(0,1.2,0)
    rot(7,43) trans(0.6,0,0)


  3. Multiplying out the matrices gives:
    [ 0  0 1 0 ]
    [ 0 -1 0 0 ]
    [ 1  0 0 0 ]
    [ 0  0 0 1 ]
    
    or, equivalently as a 3x3 matrix
    
    [no translations occur, so a 3x3 matrix could be used to represent
     the transformation in 3D cartesian coordinates, instead of the
     usual 4D homogeneous coordinates]
    
    [ 0  0 1 ]
    [ 0 -1 0 ]
    [ 1  0 0 ]
    
    
    (only the rotational part of the matrix matters in this case)
    With some thought, this can be seen to be a 180 degree rotation about the axis having the direction <1,0,1>. There does exist a general method for taking any 3x3 rotation matrix and determining the equivalent single-axis rotation.

  4. One solution is:

    trans(1,0,0) rot(z,45) rot(x,theta) rot(z,-45) trans(-1,0,0)

    The key is to move any part of the axis q so that it passes through the origin, then align the axis with the origin, do the desired rotation, and undo everything.

  5.           -1      -1 -1 -1
     (A  B  C)    =  C  B  A
    
     = rot(y,-beta) rot(z,-alpha) trans(-a,-b,-c)
    


  6. There are several ways to solve this.
    1. (Uses very dubious arithmetic):

      We can express the matrix

      [ Ax Bx Cx Tx ]
      [ Ay By Cy Ty ]
      [ Az Bz Cz Tz ]
      [ 0  0  0  1  ]
      
      as a two-by-two matrix,
      [M T]
      [0 1]
      
      where each element is not just a number, but a matrix in itself: M is a 3x3 rotation matrix, T is a 3x1 matrix, 0 is a 1x3 matrix, and 1 is just 1.

      Now we use an analogy with a two-by-two matrix of numbers, and its inverse:

           -1            -1
      [a b]   = (ad - bc)  [ d -b]
      [c d]                [-c  a]
      
      hence we expect that
           -1            -1
      [M T]   = (M1 - 0T)  [ 1 -T]
      [0 1]                [-0  M]
      
      but
               -1    -1
      (M1 - 0T)   = M
      
      so
           -1    -1             -1   -1
      [M T]   = M  [ 1 -T]  = [M   -M  T]
      [0 1]        [-0  M]    [0      1 ]
      
      now M is orthogonal, so its inverse is its transpose:
       -1    t
      M   = M
      
      so our final result is:
           -1    t   t
      [M T]   =[M  -M T]
      [0 1]    [0     1]
      
    2. We are looking for the following:
      [ 1 0 0 0 ]    [ ? ? ? ? ] [ Ax Bx Cx Tx ]
      [ 0 1 0 0 ] =  [ ? ? ? ? ] [ Ay By Cy Ty ]
      [ 0 0 1 0 ]    [ ? ? ? ? ] [ Az Bz Cz Tz ]
      [ 0 0 0 1 ]    [ ? ? ? ? ] [ 0  0  0  1  ]
      
      Now let's use the facts we know, namely that A,B,C are an orthonormal set of vectors. Thus each of A,B,C is of unit size, and they are all at right angles to each other:
        A.A = 1  
        A.B = 0
        A.C = 0
      
        B.B = 1
        ... etc
      
      Writing the equation for element (1,1) gives:
        A.? = 1
      
      One possible solution is to let ? = A.
      In a similar fashion, we can obtain the first three columns of rows two and three, giving:
      [ 1 0 0 0 ]    [ Ax Ay Az ? ] [ Ax Bx Cx Tx ]
      [ 0 1 0 0 ] =  [ Bx By Bz ? ] [ Ay By Cy Ty ]
      [ 0 0 1 0 ]    [ Cx Cy Cz ? ] [ Az Bz Cz Tz ]
      [ 0 0 0 1 ]    [ ?  ?  ?  ? ] [ 0  0  0  1  ]
      
      Note that the zeroes in the top-left 3x3 corner of the identity matrix are also satisfied. For example, for element (1,2):
       0 = Ax*Bx + Ay*By + Az*Bz + ?*0 = A.B = 0
      
      Placing [ 0 0 0 1 ] in the bottom row satisfies the equations arising from the bottom row of the identity matrix.

      Lastly, we have the following equations:

        0 = Tx*Ax + Ty*Ay + Tz*Az + ?
        0 = Tx*Bx + Ty*By + Tz*Bz + ?
        0 = Tx*Cx + Ty*Cy + Tz*Cz + ?
      
      From the above, the uknowns can be directly determined as
       -T.A
       -T.B
       -T.C
      
      The final result is thus:
      [ 1 0 0 0 ]    [ Ax Ay Az -T.A ] [ Ax Bx Cx Tx ]
      [ 0 1 0 0 ] =  [ Bx By Bz -T.B ] [ Ay By Cy Ty ]
      [ 0 0 1 0 ]    [ Cx Cy Cz -T.C ] [ Az Bz Cz Tz ]
      [ 0 0 0 1 ]    [  0  0  0   1  ] [ 0  0  0  1  ]