\documentclass[12pt]{article}

%%%--------- Set up page size and formatting information ----------%%%
\usepackage{epsfig}
\usepackage{amsmath}
\def\newpage{\par\vfill\eject}	%new page macro
\def\tab{\ \ \ \ \ }		%tab in five spaces
\def\dtab{{\tab}{\tab}}         %double tab

\setlength{\textwidth}{6.5in}
\setlength{\textheight}{9.0in}
\setlength{\topmargin}{-0.51in}
\setlength{\oddsidemargin}{0.0in}
\parskip 2ex
\parindent=0pt

\input reals.tex 
%%%----------------------------------------------------------------------%%%
\begin{document}
\input reals.tex

\centerline{\bf ME 115(a):  Solution to Homework $\#1$}
\vskip 0.5 true in

%%%-------------------------------------------------------------------------%%%
{\bf Problem 1: Problem 12, Chapter 2 of MLS} 

We know from Lemma 2.3 that:\\
$$\hat{\omega}^3 = -||\omega||^2 \hat{\omega}$$\
$$\hat{\omega}^4  = -||\omega||^2 \hat{\omega^2}$$\
$$\hat{\omega}^5 =  ||\omega||^4 \hat{\omega}$$\
$$\hat{\omega}^6 =  ||\omega||^4 \hat{\omega}^2$$\
$$\hat{\omega}^7 = -||\omega||^6 \hat{\omega}$$\
$$\hat{\omega}^8 = -||\omega||^6 \hat{\omega}^2$$\
Plugging these values into the matrix exponential:
  \[ \begin{array}{rl}
    e^{\hat{\omega}\theta} 
     &= I + \hat{\omega}\theta  + \frac{(\hat{\omega}\theta)^2}{2!} 
          + \frac{(\omega\theta)^3}{3!}  + \cdots \\
     &= I + (\theta\hat{\omega}+\frac{(\theta\hat{{\omega}})^3}{3!}+\cdots) +  (\frac{(\theta\hat{{\omega}})^2}{2!}+ \frac{(\theta\hat{{\omega}})^4}{4!} + \cdots) \\
     &=I + (\theta ||\omega|| - \frac{ (\theta ||\omega||)^3}{3!} + \cdots)  \frac{\hat\omega}{||\omega||}  +( \frac{(\theta ||\omega||)^2}{2!} - \frac{ (\theta ||\omega||)^4}{4!} + \cdots) \frac{\hat\omega^2}{||\omega||^2} \\
     &=I + sin(||\omega||\theta)\frac{\hat{\omega}}{||\omega||} + (1 - cos(||\omega|| \theta) \frac{\hat{\omega}^2}{||\omega||^2} \\
      \end{array} \]
     

%%%-------------------------------------------------------------------------%%%
{\bf Problem 2: Problem 10(a,b), Chapter 2 of MLS} 
\begin{itemize}
\item{}{\bf Part (a):}
Let:
\[A= \left[\begin{array}{cc}\vec{a}_1 & \vec{a}_2\end{array}\right] =  \left[ \begin{array}{cc} a_{11} & a_{12}\\
                         a_{21} & a_{22} \\
           \end{array}\right] \]
        where $A\in$ SO(2).  Thus det(A) = 1, and $A^{-1} = A^{T}$.
        
       \[ A^{T}A=  
            \left[ \begin{array}{cc} a_{11}^2 + a_{21}^2 & a_{11}a_{12} + a_{21} a_{22}\\
                       a_{11}a_{21} + a_{21}a_{22}  & a_{12}^2 + a_{22}^2 \\
           \end{array}\right]   = 
                       \left[ \begin{array}{cc} 1  &0\\
                0 &1 \\
           \end{array}\right]  \] 
           
 Solving the above equations, we find that $a_{21}= -a_{12}$, and $a_{22} = a_{11}$.  Given that det(A) =1, we know that $a_{11}a_{22} - a_{21}a_{12}$ = 1.   Setting $a_{11} = cos\theta, a_{12} = sin\theta, a_{21} = sin\theta$, and $a_{22} = cos\theta$ meets these requirements. 
           
               \[ A=
            \left[ \begin{array}{cc} cos\theta & -sin\theta\\
                       sin\theta & cos\theta\\
           \end{array}\right]    \]

Both vectors $\vec{a}_1$ and $\vec{a}$ are elements of $S^1$, the unit circle.
\item{}{\bf Part (b):}
If $\omega\in\real$, then let:
  \[ \hat{\omega} = \begin{bmatrix} 0 & -\omega\\ \omega & 0\end{bmatrix}
             = \omega J \tab {\rm where}\ 
     J =  \begin{bmatrix} 0 & -1\\ 1 & 0\end{bmatrix} \]
Note that:
  \[ \hat{\omega}^2 = -\omega^2 I; \tab \hat{\omega}^3 = \omega^3 J \]
Hence:
  \[ \begin{array}{rl}
    e^{\hat{\omega}\theta} 
     &= I + \omega\theta J + \frac{(\omega\theta)^2}{2!} J^2 
          + \frac{(\omega\theta)^3}{3!} J^3 + \cdots \\
     &= I + (\omega\theta) J - \frac{(\omega\theta)^2}{2!} I 
         - \frac{(\omega\theta)^3}{3!} J + \cdots \\
     &= (1 + \frac{(\omega\theta)^2}{2!} + \frac{(\omega\theta)}{4!}
           + \cdots )I
       +(\omega\theta - \frac{(\omega\theta)^3}{3!} + \cdots) J \\
     &= \cos(\omega\theta) I + \sin(\omega\theta) J \\
     &\quad \\ 
     &= \begin{bmatrix}\cos(\omega\theta) & -\sin(\omega\theta)\\ 
                      \sin(\omega\theta) &  \cos(\omega\theta)\end{bmatrix}
      \end{array} \]
      
\end{itemize}


%%%-------------------------------------------------------------------------%%%
{\bf Problem 3: Problem 8(b), Chapter 2 of MLS} 
   \begin{eqnarray*}
      e^{g\Lambda g^{-1}} &=& I + \frac{1}{1!} g\Lambda g^{-1}
        + \frac{1}{2!} (g\Lambda g^{-1})^2 + \frac{1}{3!}(g\Lambda g^{-1})^3
	+ \cdots \\
   &=& I + \frac{1}{1!} g\Lambda g^{-1}
        + \frac{1}{2!} (g\Lambda^2 g^{-1}) + \frac{1}{3!}(g\Lambda^3 g^{-1})
	+ \cdots \\
   &=& g(I + \frac{1}{1!} \Lambda
        + \frac{1}{2!} \Lambda^2 + \frac{1}{3!}\Lambda^3 + \cdots)g^{-1} \\
   &=& ge^{\Lambda}g^{-1} \end{eqnarray*}

%%%-------------------------------------------------------------------------%%%
{\bf Problem 4: Problem 5, Chapter 2 of MLS} 

\begin{itemize}
\item{}{\bf Part (a):}

   \begin{eqnarray*}
     R_aR_a^T&=& (I -\hat{a})^{-1} (I +\hat{a}) (I + \hat{a})^{T} (I -\hat{a})^{-T} \\
   &=& (I - \hat{a})^{-1} (I + \hat{a}) (I - \hat{a}) (I +\hat{a}) ^ {-1}\\
      &=& (I - \hat{a})^{-1} (I - \hat{a}) (I + \hat{a}) (I + \hat{a}) ^{-1}\\
      &=& I * I\\
      &=& I\end{eqnarray*}
This means that det $(R_a)$ =  1, and thays $R_a\in$ SO(3) .

\item{}{\bf Part (b):}  
This part can be done, by hand or using Mathematica, by simply expanding out the equation from part (a):
 $$R_a = (I - \hat{a})^{-1} (I + \hat{a}).$$ 
\item{} {\bf Part (c):}   There are
two ways to solve this.  The simplest way is to use the result of part
5(b) quoted in the text:

\begin{equation}\label{eq:cayley}
   R= \frac{1}{1+||a||^2}\begin{bmatrix} 
     1 + a_1^2-a_2^2-a_3^2 & 2(a_1 a_2 - a_3)      & 2(a_1 a_3 + a_2)\\
        2(a_1 a_2 + a_3)   & 1 - a_1^2+a_2^2-a_3^2 & 2(a_2 a_3 - a_1)\\
        2(a_1 a_3 - a_2)   & 2(a_2 a_3 + a_1)      & 1 - a_1^2-a_2^2+a_3^2
    \end{bmatrix} \end{equation}
where $||a||^2$ is shorthand notation for $||a||^2=a_1^2+a_2^2+a_3^2$.
Noting that 
   \[ trace(R)= \frac{3-||a||^2}{1+||a||^2} \Rightarrow 
     ||a||^2 = \frac{3-trace(R)}{1+trace(R)} 
             = \frac{3-r_{11}-r_{22}-r_{33}}{1+r_{11}+r_{22}+r_{33}} \]
so that an expression for $||a||^2$ is known, 
simple algebraic manipulation of the off-diagonal term of $R$ yield
  \[ \begin{bmatrix} a_1 \\ a_2 \\ a_3 \end{bmatrix}
     = \frac{1+||a||^2}{4} \begin{bmatrix} r_{32}-r_{23} \\ r_{13}-r_{31} \\
       r_{21} - r_{12} \end{bmatrix} \]
     
\end{itemize}


%%%-------------------------------------------------------------------------%%%
{\bf Problem 5:}


To show that $\rm{cofactor}(r_{ii}) = r_{ii}$, let

  \[  R= \begin{bmatrix} r_{11} & r_{12} & r_{13} \\
                         r_{21} & r_{22} & r_{23} \\
                         r_{31} & r_{32} & r_{33} \end{bmatrix}. \]

The columns of this matrix are unit vectors, which can be denoted as:
\[ {\bf x} = \begin{bmatrix} r_{11} \\ r_{21} \\ r_{31} \end{bmatrix}
             \hskip 0.5 true in
   {\bf y} = \begin{bmatrix} r_{12} \\ r_{22} \\ r_{32} \end{bmatrix}
             \hskip 0.5 true in
   {\bf z} = \begin{bmatrix} r_{13} \\ r_{23} \\ r_{33} \end{bmatrix} \]
These columns can be interpreted as the unit vectors of an orthogonal
right handed coordinate system.  Consequently, 
  \[ {\bf x} = {\bf y} \times {\bf z}; \hskip 0.5 true in
     {\bf y} = {\bf z} \times {\bf x}; \hskip 0.5 true in
     {\bf z} = {\bf x} \times {\bf y} \]
Performing the cross product and equating sides for ${\bf x}={\bf y}\times
{\bf z}$, we get the relation:
  \begin{equation}
      \begin{bmatrix} r_{11} \\ r_{21} \\ r_{31} \end{bmatrix}
     = \begin{bmatrix} r_{22} r_{33} - r_{23} r_{32} \\
		       r_{13} r_{32} - r_{12} r_{33} \\
	 	       r_{12} r_{23} - r_{13} r_{22} \end{bmatrix}
     = \begin{bmatrix} \rm{cofactor}(r_{11}) \\
		      \rm{cofactor}(r_{21}) \\
		      \rm{cofactor}(r_{31})  \end{bmatrix} 
  \end{equation}

Similar relationships can be derived for the other columns to show that
$r_{ij} = {\rm cofactor}(r_{ij})$ for all elements of a special orthogonal
matrix.

%%%-------------------------------------------------------------------------%%%
{\bf Problem 6:  Problem 4(a,b) in Chapter 2 of MLS} 
\vskip 0.2 true in
\begin{itemize}

\item{}{\bf Part (a):} Let's assume that the statement in part (b) of the problem is
true.  Let $\vec{w}$ be a $3\times 1$ vector and let $\vec{v}$ be any $3\times
1$ vector.  Then:

  \[\begin{array}{rl}
       (R\hat{w}R^T) \vec{v} &= R\hat{w}(R^T\vec{v}) \\
                             &= R(\vec{w} \times (R^T\vec{v})) \\ 
                             &= (R\vec{w}) \times (RR^T\vec{v}) \\
                             &= (R\vec{w}) \times \vec{v}\\
                             &= \widehat{(R\vec{w})}  \vec{v} \end{array} \]

Since this must be true for any vector $\vec{v}$, then
$R\hat{w}R^T = (R\vec{w})^{\hat{}}$.

\item{}{\bf Part (b):} We can now assume that part (a) holds.

   \[\begin{array}{rl}
     (R\vec{v})\times(R\vec{w}) &= \widehat{(R\vec{v})} (R\vec{w}) \\ 
                                &= (R\hat{v}R^T)(R\vec{w}) \\ 
			        &= R\hat{v} R^T R \vec{w} \\ 
			        &= R(\hat{v}\vec{w})\\ 
		                &= R(\vec{v}\times\vec{w}) \end{array}\]
\end{itemize}
%%%-------------------------------------------------------------------------%%%
{\bf Problem 7:}
\\
Find the axis of rotation and angle of rotation associated 
with the rotation matrix:
  \[ \begin{bmatrix} 0.866025 & -0.353553 &  0.353553 \\
	  	     0.353553  &  0.933013& 0.0669873 \\
		    -0.353553 &  0.0669873 &  0.933013 \end{bmatrix} \]

From Eq. (2.17) in the MLS text:

   \[ \cos(\phi) = \frac{r_{11} + r_{22} + r_{33} -1}{2} 
	        = \frac{0.866025+ 0.933013 + 0.933013 - 1.0}{2}
                = 0.866\]

Thus, $\phi=\cos^{-1}(0.866) = 30^o$.  Thus, $\sin(\phi) = 0.5$, and
therefore from Eq. (2.18) of the MLS text:

   \[ \begin{array}{rl}
      \omega_x &= \frac{r_{32} - r_{23}}{2\sin\phi} = 0.0 \\ 
      \omega_y &= \frac{r_{13} - r_{31}}{2\sin\phi} = 0.7071\\ 
      \omega_z &= \frac{r_{21} - r_{12}}{2\sin\phi} = 0.7071 \end{array}
    \]


\end{document}

