Difference between revisions of "File talk:Affine transformations.pdf"

From BRL-CAD
Line 1: Line 1:
<nowiki>
+
%%% affine_transformations.tex %%%
%%% affine_transformations.tex %%%
+
\documentclass[a4paper,11pt]{article}
\documentclass[a4paper,11pt]{article}
+
\usepackage[utf8x]{inputenc}
\usepackage[utf8x]{inputenc}
+
\usepackage{graphicx}
\usepackage{graphicx}
+
\usepackage{type1cm}
\usepackage{type1cm}
+
\usepackage{eso-pic}
\usepackage{eso-pic}
+
\usepackage{color}
\usepackage{color}
+
\usepackage{pstricks}
\usepackage{pstricks}
+
\usepackage{amsmath, amssymb, textcomp, mathrsfs}
\usepackage{amsmath, amssymb, textcomp, mathrsfs}
+
\usepackage{boxdims}
\usepackage{boxdims}
+
\usepackage{bbm}
\usepackage{bbm}
+
\usepackage{colortbl}
\usepackage{colortbl}
+
\usepackage{fancyhdr}
\usepackage{fancyhdr}
+
\usepackage[a4paper, left=2.5cm, right=2.5cm, top=2.5cm, bottom=5cm]{geometry}
\usepackage[a4paper, left=2.5cm, right=2.5cm, top=2.5cm, bottom=5cm]{geometry}
+
\usepackage{soul}
\usepackage{soul}
+
\usepackage{multirow}
\usepackage{multirow}
+
\usepackage{listings}
\usepackage{listings}
+
\usepackage{tensor}
\usepackage{tensor}
+
\usepackage{verbatim}
\usepackage{verbatim}
+
\usepackage{wasysym}
\usepackage{wasysym}
+
\usepackage{marvosym}
\usepackage{marvosym}
+
\usepackage[pdftex, colorlinks=true]{hyperref}
\usepackage[pdftex, colorlinks=true]{hyperref}
+
 
+
\newtheorem{postulate}{Postulate}
 
+
\newtheorem{corollary}{Corollary}
\newtheorem{postulate}{Postulate}
+
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
+
\newtheorem{theorem}{Theorem}
+
\newenvironment{proof}[1][Proof]{\noindent{}\textbf{#1 } }{\ \rule{0.4em}{0.7em}\\}
 
+
\newenvironment{proof}[1][Proof]{\noindent{}\textbf{#1 } }{\ \rule{0.4em}{0.7em}\\}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+
%
 
+
% The following will put the MS-Word style table
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
% on the top of each page.
%
+
%
% The following will put the MS-Word style table
+
% You need to fill in the information for each new
% on the top of each page.
+
% document / revision!
%
+
%
% You need to fill in the information for each new
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% document / revision!
+
%
+
\pagestyle{fancy}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 
+
\fancyhf{}
\pagestyle{fancy}
+
\renewcommand{\headrulewidth}{0pt}
 
+
\fancyhf{}
+
\lhead{\begin{tabular}{|p{0.26\linewidth}|p{0.17\linewidth}|p{0.17\linewidth}|p{0.11\linewidth}|p{0.19\linewidth}|}
\renewcommand{\headrulewidth}{0pt}
+
  \hline
 
+
  \multirow{4}{*}{\includegraphics[width=4cm]{pictures/GCI.png}}  
\lhead{\begin{tabular}{|p{0.26\linewidth}|p{0.17\linewidth}|p{0.17\linewidth}|p{0.11\linewidth}|p{0.19\linewidth}|}
+
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}{  }}\\
  \hline
+
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}\Large{Google Code-In 2012--BRL-CAD:}}\\
  \multirow{4}{*}{\includegraphics[width=4cm]{pictures/GCI.png}}
+
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}\Large{Some Basic Affine Transformations}}\\
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}{  }}\\
+
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}{  }}\\
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}\Large{Google Code-In 2012--BRL-CAD:}}\\
+
    \cline{2-5}
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}\Large{Some Basic Affine Transformations}}\\
+
&Document No. &N/A &Author &Matt S.\\
&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}{  }}\\
+
    \cline{2-5}
    \cline{2-5}
+
&Revision &0.1 &Date &Dec. 2012\\
&Document No. &N/A &Author &Matt S.\\
+
  \hline
    \cline{2-5}
+
  \end{tabular}}
&Revision &0.1 &Date &Dec. 2012\\
+
\chead{}
  \hline
+
\rhead{}
  \end{tabular}}
+
\chead{}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\rhead{}
+
%
 
+
% The NDA reminder is then inserted as a
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
% persistent footnote as well.
%
+
%
% The NDA reminder is then inserted as a
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% persistent footnote as well.
+
%
+
\lfoot{}%{\tiny{Inser NDA as persistent footer here if required.}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\cfoot{}
 
+
\rfoot{\thepage}
\lfoot{}%{\tiny{Inser NDA as persistent footer here if required.}}
+
\renewcommand{\footrulewidth}{0.4pt}
\cfoot{}
+
\rfoot{\thepage}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\footrulewidth}{0.4pt}
+
%
 
+
% Rather than going to the trouble of creating a
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
% new .cls file--which should be done--this hack is
%
+
% inserted to satisfy the article.cls requirements.
% Rather than going to the trouble of creating a
+
% Without it, the first page is a mess.
% new .cls file--which should be done--this hack is
+
%
% inserted to satisfy the article.cls requirements.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Without it, the first page is a mess.
+
%
+
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\thispagestyle{fancy}
 
+
\section*{}  
\begin{document}
+
\vspace{2cm}
\thispagestyle{fancy}
+
\section*{}  
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace{2cm}
+
%
 
+
% Document control / revision history table.  Do not
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
% forget to update; check to make sure the file name
%
+
% matches the rev. no; there should be a way to
% Document control / revision history table.  Do not
+
% automate this.
% forget to update; check to make sure the file name
+
%
% matches the rev. no; there should be a way to
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% automate this.
+
%
+
\begin{tabular}{|p{0.18\linewidth}|p{0.18\linewidth}|p{0.18\linewidth}|p{0.39\linewidth}|}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\hline
 
+
\rowcolor[gray]{.8}\textbf{Rev.} &\textbf{Author} &\textbf{Date} &\textbf{Summary of Changes}\\
\begin{tabular}{|p{0.18\linewidth}|p{0.18\linewidth}|p{0.18\linewidth}|p{0.39\linewidth}|}
+
\hline
\hline
+
0.0 &Matt S. &01/12/2012 &Document created.\\
\rowcolor[gray]{.8}\textbf{Rev.} &\textbf{Author} &\textbf{Date} &\textbf{Summary of Changes}\\
+
\hline
\hline
+
0.1 &Matt S. &08/12/2012 &Typos fixed.\\
0.0 &Matt S. &01/12/2012 &Document created.\\
+
\hline
\hline
+
\end{tabular}
0.1 &Matt S. &08/12/2012 &Typos fixed.\\
+
\hline
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{tabular}
+
%
 
+
% Start document here
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
%
%
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Start document here
+
%
+
\tableofcontents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 
+
\newpage
\tableofcontents
+
 
+
\section{Some Basic Affine Transformations}
\newpage
+
A lot more well-written information is available on the Internet,  
 
+
so I won't go into any real detail here.  Instead, the interested  
\section{Some Basic Affine Transformations}
+
reader may refer to \href{http://www.cis.upenn.edu/~cis610/geombchap2.pdf}
A lot more well-written information is available on the Internet, so I won't go into any real detail here.  Instead, the interested reader may refer to \href{http://www.cis.upenn.edu/~cis610/geombchap2.pdf}{this primer}, among many others.\\
+
{this primer}, among many others.\\
 
+
This article will simply provide formulae to accomplish specific tasks.
+
This article will simply provide formulae to accomplish specific tasks.
 
+
\subsection{Affine Translation of Points}
+
\subsection{Affine Translation of Points}
Assume we have a collection of discreet points $\left\lbrace x_i \right\rbrace\subset\mathbbm{R}^3$ that we want to rigidly translate in such a way that a specific point $x_0$ is translated to the origin, thus preserving the relative placement of all points.\\
+
Assume we have a collection of discreet points $\left\lbrace x_i
 
+
\right\rbrace\subset\mathbbm{R}^3$ that we want to rigidly translate in
To do this, create a vector
+
such a way that a specific point $x_0$ is translated to the origin, thus
%  
+
preserving the relative placement of all points.\\
\begin{equation*}
+
b = \left[\begin{array}{c}
+
To do this, create a vector
    x^1\\
+
%  
    x^2\\
+
\begin{equation*}
    x^3\end{array}\right]
+
b = \left[\begin{array}{c}
\end{equation*}
+
    x^1\\
%  
+
    x^2\\
and then create the augmented matrix
+
    x^3\end{array}\right]
%  
+
\end{equation*}
\begin{equation*}
+
%  
A_T = \left[\begin{array}{cr}
+
and then create the augmented matrix
    I_3 &-b\\
+
%  
    0  &1\end{array}\right]
+
\begin{equation*}
\end{equation*}
+
A_T = \left[\begin{array}{cr}
%
+
    I_3 &-b\\
so that for each $x_i$, we compute
+
    0  &1\end{array}\right]
%
+
\end{equation*}
\begin{equation*}
+
%
\left[\begin{array}{c}
+
so that for each $x_i$, we compute
    y_i\\
+
%
    1\end{array}\right] =
+
\begin{equation*}
\left[\begin{array}{cr}
+
\left[\begin{array}{c}
    I_3 &-b\\
+
    y_i\\
    0  &1\end{array}\right]
+
    1\end{array}\right] =
\left[\begin{array}{cr}
+
\left[\begin{array}{cr}
    x_i\\
+
    I_3 &-b\\
    1\end{array}\right]
+
    0  &1\end{array}\right]
\end{equation*}
+
\left[\begin{array}{cr}
%
+
    x_i\\
where the $y_i$ represent the translated $x_i$.
+
    1\end{array}\right]
 
+
\end{equation*}
\subsection{Affine Rotation About an Axis}
+
%
The cheat that we have performed here is that by first translating all points of interest to the origin, we may now rotate about an axis to make all our points coincident to a Cartesian plane; let's say the $x^1 - x^2$ plane.\\
+
where the $y_i$ represent the translated $x_i$.
 
+
First, we take three points $\left\lbrace y_0, y_1, y_2 \right\rbrace\subseteq\left\lbrace y_i \right\rbrace$ and determine the normal via
+
\subsection{Affine Rotation About an Axis}
%  
+
The cheat that we have performed here is that by first translating all
\begin{equation*}
+
points of interest to the origin, we may now rotate about an axis to make
n = y_1\times y_2
+
all our points coincident to a Cartesian plane; let's say the $x^1 - x^2$
\end{equation*}
+
plane.\\
%  
+
since $y_0 = 0$ now, thus allowing us treat the coordinates $y_1$ and $y_2$ as vector elements in the computation of $n$.  This allows us to determine the angle $\varphi$ between $n$ and $y^3$ via
+
First, we take three points $\left\lbrace y_0, y_1, y_2
%  
+
\right\rbrace\subseteq\left\lbrace y_i \right\rbrace$ and determine
\begin{equation*}
+
the normal via
\cos\left( \varphi \right) = \frac{n\cdot y^3}{\left\|n\right\|}
+
%  
\end{equation*}
+
\begin{equation*}
%  
+
n = y_1\times y_2
where we treat $y^3$ as a unit vector $\left(0,0,1\right)$.  Then, compute a unit normal vector to the plane defined by $\text{span}\left(n,y^3\right)$ via
+
\end{equation*}
%  
+
%  
\begin{align}
+
since $y_0 = 0$ now, thus allowing us treat the coordinates $y_1$ and $y_2$
u =& n\times y^3\notag\\
+
as vector elements in the computation of $n$.  This allows us to determine
\Rightarrow u_{\mu} =& \frac{1}{\left\| u \right\|} u \notag
+
the angle $\varphi$ between $n$ and $y^3$ via
\end{align}  
+
%  
%  
+
\begin{equation*}
so that we may align $n$ and $y^3$ via the \href{http://en.wikipedia.org/wiki/Rotation_matrix}{rotation}  
+
\cos\left( \varphi \right) = \frac{n\cdot y^3}{\left\|n\right\|}
%  
+
\end{equation*}
\begin{equation*}
+
%  
R = I_3 \cos\varphi +  
+
where we treat $y^3$ as a unit vector $\left(0,0,1\right)$.  Then, compute
    \sin\varphi\left[u_{\mu}\right]_{\times} +  
+
a unit normal vector to the plane defined by $\text{span}\left(n,y^3\right)$
    \left(1-\cos\varphi\right)u_{\mu}\otimes u_{\mu}
+
via
\end{equation*}
+
%  
%
+
\begin{align}
where
+
u =& n\times y^3\notag\\
%  
+
\Rightarrow u_{\mu} =& \frac{1}{\left\| u \right\|} u \notag
\begin{align}
+
\end{align}  
\left[u_{\mu}\right]_{\times} =&  
+
%  
  \left[\begin{array}{rrr}
+
so that we may align $n$ and $y^3$ via the \href{http://en.wikipedia.org/wiki/Rotation_matrix}{rotation}  
    0 &-u_{\mu}^3 &u_{\mu}^2\\
+
%  
    u_{\mu}^3 &0 &-u_{\mu}^1\\
+
\begin{equation*}
    -u_{\mu}^2 &u_{\mu}^1 &0\end{array}\right]\notag\\
+
R = I_3 \cos\varphi +  
u_{\mu}\otimes u_{\mu} =&
+
    \sin\varphi\left[u_{\mu}\right]_{\times} +  
    \left[\begin{array}{lll}
+
    \left(1-\cos\varphi\right)u_{\mu}\otimes u_{\mu}
    \left( u_{\mu}^1 \right)^2 &u_{\mu}^1 u_{\mu}^2 &u_{\mu}^1 u_{\mu}^3\\
+
\end{equation*}
    u_{\mu}^1 u_{\mu}^2 &\left( u_{\mu}^2 \right)^2 &u_{\mu}^2 u_{\mu}^3\\
+
%
    u_{\mu}^1 u_{\mu}^3 &u_{\mu}^2 u_{\mu}^3 &\left( u_{\mu}^3 \right)^2
+
where
    \end{array}\right]\notag
+
%  
\end{align}
+
\begin{align}
%  
+
\left[u_{\mu}\right]_{\times} =&  
Finally, this allows us to then define an augmented (rotation) matrix
+
  \left[\begin{array}{rrr}
%  
+
    0 &-u_{\mu}^3 &u_{\mu}^2\\
\begin{equation*}
+
    u_{\mu}^3 &0 &-u_{\mu}^1\\
A_R = \left[\begin{array}{cl}
+
    -u_{\mu}^2 &u_{\mu}^1 &0\end{array}\right]\notag\\
    R &0\\
+
u_{\mu}\otimes u_{\mu} =&
    0 &1\end{array}\right]
+
    \left[\begin{array}{lll}
\end{equation*}  
+
    \left( u_{\mu}^1 \right)^2 &u_{\mu}^1 u_{\mu}^2 &u_{\mu}^1 u_{\mu}^3\\
%  
+
    u_{\mu}^1 u_{\mu}^2 &\left( u_{\mu}^2 \right)^2 &u_{\mu}^2 u_{\mu}^3\\
allowing us to rotate our collection of points $\left\lbrace y_i \right\rbrace$ into the $y^1-y^2$ plane via
+
    u_{\mu}^1 u_{\mu}^3 &u_{\mu}^2 u_{\mu}^3 &\left( u_{\mu}^3 \right)^2
%  
+
    \end{array}\right]\notag
\begin{equation*}
+
\end{align}
\left[\begin{array}{c}
+
%  
    z_i\\
+
Finally, this allows us to then define an augmented (rotation) matrix
    1\end{array}\right] =
+
%  
\left[\begin{array}{cr}
+
\begin{equation*}
    R &0\\
+
A_R = \left[\begin{array}{cl}
    0  &1\end{array}\right]
+
    R &0\\
\left[\begin{array}{cr}
+
    0 &1\end{array}\right]
    y_i\\
+
\end{equation*}  
    1\end{array}\right]
+
%  
\end{equation*}  
+
allowing us to rotate our collection of points $\left\lbrace y_i  
%  
+
\right\rbrace$ into the $y^1-y^2$ plane via
and we may now very easily compute the area of the polygon defined by the points $z_i$ via Green's Theorem.
+
%  
 
+
\begin{equation*}
\end{document}
+
\left[\begin{array}{c}
</nowiki>
+
    z_i\\
 +
    1\end{array}\right] =
 +
\left[\begin{array}{cr}
 +
    R &0\\
 +
    0  &1\end{array}\right]
 +
\left[\begin{array}{cr}
 +
    y_i\\
 +
    1\end{array}\right]
 +
\end{equation*}  
 +
%  
 +
and we may now very easily compute the area of the polygon defined by the points $z_i$ via Green's Theorem.
 +
 +
\end{document}

Revision as of 01:26, 8 December 2012

%%% affine_transformations.tex %%%
\documentclass[a4paper,11pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}
\usepackage{type1cm}
\usepackage{eso-pic}
\usepackage{color}
\usepackage{pstricks}
\usepackage{amsmath, amssymb, textcomp, mathrsfs}
\usepackage{boxdims}
\usepackage{bbm}
\usepackage{colortbl}
\usepackage{fancyhdr}
\usepackage[a4paper, left=2.5cm, right=2.5cm, top=2.5cm, bottom=5cm]{geometry}
\usepackage{soul}
\usepackage{multirow}
\usepackage{listings}
\usepackage{tensor}
\usepackage{verbatim}
\usepackage{wasysym}
\usepackage{marvosym}
\usepackage[pdftex, colorlinks=true]{hyperref}

\newtheorem{postulate}{Postulate}
\newtheorem{corollary}{Corollary}
\newtheorem{theorem}{Theorem}

\newenvironment{proof}[1][Proof]{\noindent{}\textbf{#1 } }{\ \rule{0.4em}{0.7em}\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The following will put the MS-Word style table
% on the top of each page.
%
% You need to fill in the information for each new
% document / revision!
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagestyle{fancy}

\fancyhf{}
\renewcommand{\headrulewidth}{0pt}

\lhead{\begin{tabular}{|p{0.26\linewidth}|p{0.17\linewidth}|p{0.17\linewidth}|p{0.11\linewidth}|p{0.19\linewidth}|}
  \hline
  \multirow{4}{*}{\includegraphics[width=4cm]{pictures/GCI.png}} 
	&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}{  }}\\
	&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}\Large{Google Code-In 2012--BRL-CAD:}}\\
	&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}\Large{Some Basic Affine Transformations}}\\
	&\multicolumn{4}{|l|}{\cellcolor[gray]{.8}{  }}\\
    \cline{2-5}
	&Document No.	&N/A		&Author	&Matt S.\\
    \cline{2-5}
	&Revision	&0.1		&Date	&Dec. 2012\\
  \hline
  \end{tabular}}
\chead{}
\rhead{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The NDA reminder is then inserted as a
% persistent footnote as well.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\lfoot{}%{\tiny{Inser NDA as persistent footer here if required.}}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\footrulewidth}{0.4pt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Rather than going to the trouble of creating a
% new .cls file--which should be done--this hack is
% inserted to satisfy the article.cls requirements.
% Without it, the first page is a mess.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\thispagestyle{fancy}
\section*{} 
\vspace{2cm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Document control / revision history table.  Do not
% forget to update; check to make sure the file name
% matches the rev. no; there should be a way to
% automate this.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{tabular}{|p{0.18\linewidth}|p{0.18\linewidth}|p{0.18\linewidth}|p{0.39\linewidth}|}
\hline
\rowcolor[gray]{.8}\textbf{Rev.}	&\textbf{Author}	&\textbf{Date}	&\textbf{Summary of Changes}\\
\hline
0.0					&Matt S.		&01/12/2012	&Document created.\\
\hline
0.1					&Matt S.		&08/12/2012	&Typos fixed.\\
\hline
\end{tabular}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Start document here
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\tableofcontents

\newpage

\section{Some Basic Affine Transformations}
A lot more well-written information is available on the Internet, 
so I won't go into any real detail here.  Instead, the interested 
reader may refer to \href{http://www.cis.upenn.edu/~cis610/geombchap2.pdf}
{this primer}, among many others.\\

This article will simply provide formulae to accomplish specific tasks.

\subsection{Affine Translation of Points}
Assume we have a collection of discreet points $\left\lbrace x_i
\right\rbrace\subset\mathbbm{R}^3$ that we want to rigidly translate in
such a way that a specific point $x_0$ is translated to the origin, thus
preserving the relative placement of all points.\\

To do this, create a vector
% 
\begin{equation*}
b = \left[\begin{array}{c}
    x^1\\
    x^2\\
    x^3\end{array}\right]
\end{equation*}
% 
and then create the augmented matrix
% 
\begin{equation*}
A_T = \left[\begin{array}{cr}
    I_3 &-b\\
    0   &1\end{array}\right]
\end{equation*}
%
so that for each $x_i$, we compute
%
\begin{equation*}
\left[\begin{array}{c}
    y_i\\
    1\end{array}\right] =
\left[\begin{array}{cr}
    I_3 &-b\\
    0   &1\end{array}\right]
\left[\begin{array}{cr}
    x_i\\
    1\end{array}\right]
\end{equation*}
%
where the $y_i$ represent the translated $x_i$.

\subsection{Affine Rotation About an Axis}
The cheat that we have performed here is that by first translating all
points of interest to the origin, we may now rotate about an axis to make
all our points coincident to a Cartesian plane; let's say the $x^1 - x^2$
plane.\\

First, we take three points $\left\lbrace y_0, y_1, y_2
\right\rbrace\subseteq\left\lbrace y_i \right\rbrace$ and determine
the normal via
% 
\begin{equation*}
n = y_1\times y_2
\end{equation*}
% 
since $y_0 = 0$ now, thus allowing us treat the coordinates $y_1$ and $y_2$
as vector elements in the computation of $n$.  This allows us to determine
the angle $\varphi$ between $n$ and $y^3$ via
% 
\begin{equation*}
\cos\left( \varphi \right) = \frac{n\cdot y^3}{\left\|n\right\|}
\end{equation*}
% 
where we treat $y^3$ as a unit vector $\left(0,0,1\right)$.  Then, compute
a unit normal vector to the plane defined by $\text{span}\left(n,y^3\right)$
via
% 
\begin{align}
u =& n\times y^3\notag\\
\Rightarrow u_{\mu} =& \frac{1}{\left\| u \right\|} u \notag
\end{align} 
% 
so that we may align $n$ and $y^3$ via the \href{http://en.wikipedia.org/wiki/Rotation_matrix}{rotation} 
% 
\begin{equation*}
R = I_3 \cos\varphi + 
    \sin\varphi\left[u_{\mu}\right]_{\times} + 
    \left(1-\cos\varphi\right)u_{\mu}\otimes u_{\mu}
\end{equation*}
%
where
% 
\begin{align}
\left[u_{\mu}\right]_{\times} =& 
  \left[\begin{array}{rrr}
    0		&-u_{\mu}^3	&u_{\mu}^2\\
    u_{\mu}^3	&0		&-u_{\mu}^1\\
    -u_{\mu}^2	&u_{\mu}^1	&0\end{array}\right]\notag\\
u_{\mu}\otimes u_{\mu} =&
    \left[\begin{array}{lll}
    \left( u_{\mu}^1 \right)^2	&u_{\mu}^1 u_{\mu}^2		&u_{\mu}^1 u_{\mu}^3\\
    u_{\mu}^1 u_{\mu}^2		&\left( u_{\mu}^2 \right)^2	&u_{\mu}^2 u_{\mu}^3\\
    u_{\mu}^1 u_{\mu}^3		&u_{\mu}^2 u_{\mu}^3		&\left( u_{\mu}^3 \right)^2
    \end{array}\right]\notag
\end{align}
% 
Finally, this allows us to then define an augmented (rotation) matrix
% 
\begin{equation*}
A_R = \left[\begin{array}{cl}
    R	&0\\
    0	&1\end{array}\right]
\end{equation*} 
% 
allowing us to rotate our collection of points $\left\lbrace y_i 
\right\rbrace$ into the $y^1-y^2$ plane via
% 
\begin{equation*}
\left[\begin{array}{c}
    z_i\\
    1\end{array}\right] =
\left[\begin{array}{cr}
    R 	&0\\
    0   &1\end{array}\right]
\left[\begin{array}{cr}
    y_i\\
    1\end{array}\right]
\end{equation*} 
% 
and we may now very easily compute the area of the polygon defined by the points $z_i$ via Green's Theorem.

\end{document}