Saturday, April 7, 2012

Back to the Rotation Matrices

Here I am interested in playing with the idea of two vectors, \(\vec{u}\) and \(\vec{v}\), which define a three dimensional space, enumerated by reals \(\mathbb{R}^{3}\). I am also interested in playing with their rotational transformations and further progress the discussion in my previous post.

To this end, I will look at how to define general rotation matrices for a third unit vector, \(\hat{B}_{\parallel}\), that bisects these two original vectors. I will also look at how a three dimensional coordinate system may be constructed by defining two additional unit vectors, \(\hat{B}_{\perp}\) and \(\hat{B}_{\hat{n}}\), that result from operating on the bisecting vector with the generally defined rotation matrices.

I will start by making the following assumptions:

  1. The space defined by the two vectors, \(\vec{u}\) and \(\vec{v}\), is locally euclidean in the three dimensional space they define.
  2. The unit vector \(\hat{B}_{\parallel}\) can be expressed by the column matrix \(\begin{pmatrix} 1 \\ 0 \\ 0\end{pmatrix}\).
The second point implies the existence of an additional two or more linearly independent vectors which can be described by similar column vectors. 

The reason I am restricting the discussion to three dimensions is due to the aparent observation (which may be true or not) that we live in a space which is three dimensional and, as a result, I am interested in working in three dimensions. For now, I will leave the discussion of dimensional spaces greater than three to the following statement: One can use similar ideas as the ones presented herein to construct higher dimensional spaces. 

In the future, and for more playful reasons, I will be interested in the spaces between seven and eight dimensional space. This is due to the fact that, for a locally euclidean n-dimensional space, the volume of a sphere (n-sphere) in that space is maximized somewhere between seven and eight dimensional space:
$$V_n \left(R \right)=\frac{\pi^{ \frac{n}{2}}}{\Gamma \left(\frac{n}{2}+1 \right)}R^{n}$$
Above, \(\Gamma \left(\frac{n}{2}+1 \right)\) is the gamma function.

Ok, now to get started!

Say that there are two intersecting line segments, of length \(\left\|u\right\|\) and \(\left\|v\right\|\), somewhere in n-dimensional space at an angle \(\theta\) from one another.

Bisecting the angle \(\theta\) and defining a new line segment along the angle of bisection \(\alpha\) (I call these derived virtual line segments when working on physics problems), we can consider that the original two line segments \(\left\|u\right\|\) and \(\left\|v\right\|\) have some sort of direction relative to  each other at the point of intersection.

... more to come later ...



Wednesday, March 7, 2012

Back to the Dot (Inner) Product

Here I am interested in taking the inner product of two vectors with respect to the eigen-basis of the rotation matrices.
To calculate the dot product between two vectors one first needs two vectors, \(\vec{u}\) and \(\vec{v}\) at an angle \(\angle uOv\), denoted by \(\theta\), from each other. It is possible to bisect the angle \(\theta\) and define a unit bisection vector \(\hat{B}_{\parallel}\) at an angle \(\alpha=\frac{\theta}{2}\) from both \(\vec{u}\) and \(\vec{v}\). Since the two vectors, \(\vec{u}\) and \(\vec{v}\) define a plane, we are then free to choose an eigen-vector of the rotation matrix:

$$


\mathbf{R}^{3}_{\parallel}\left(\phi_{\parallel}\right)=
\begin{pmatrix}
1 & 0 & 0 \\
0 & \cos\phi_{\parallel} & -\sin\phi_{\parallel}\\
0 & \sin\phi_{\parallel} & \cos\phi_{\parallel}
\end{pmatrix}


$$
to be the unit bisecting vector \(\hat{B}_{\parallel}\) parallel to the plane. From the previous post the reader should be aware that there are three such eigen-vectors. Note that I have included an unknown angle \(\phi\) to take into consideration that the plane defined by the two vectors \(\vec{u}\) and \(\vec{v}\) can be oriented by any angle \(\phi\) around the bisecting unit vector, \(\hat{B}_{\parallel}\).
The vector perpendicular to \(\hat{B}_{\parallel}\), denoted by \(\hat{B}_{\perp}\), is then defined as an eigen-vector of the rotation matrix:
$$
\mathbf{R}^{3}_{\perp}\left(\phi_{\perp}\right)=
\begin{pmatrix}
\cos\phi_{\perp} & 0 & \sin\phi_{\perp} \\
0 & 1 & 0\\
-\sin\phi_{\perp} & 0 & \cos\phi_{\perp}
\end{pmatrix}
$$
The inner product of the two vectors, \(\vec{u}\) and \(\vec{v}\), with regards to the eigen-basis of \(\mathbf{R}^{3}_{\perp}\left(\phi_{\perp}\right)\) and \(\mathbf{R}^{3}_{\parallel}\left(\phi_{\parallel}\right)\) is then given by
$$
\vec{u}\cdot\vec{v}=
\left\|\vec{u}\right\| \left\|\vec{v}\right\| \cos^{2}\left(\alpha\right) \mathbf{X}^{\left(\phi_{\parallel}\right)}_{\parallel}\cdot\mathbf{X}^{\left(\phi_{\parallel}\right)}_{\parallel}
-

\left\|\vec{u}\right\| \left\|\vec{v}\right\| \sin^{2}\left(\alpha\right)
\mathbf{X}^{\left(\phi_{\perp}\right)}_{\perp}\cdot\mathbf{X}^{\left(\phi_{\perp}\right)}_{\perp} \\
=

\left\|\vec{u}\right\| \left\|\vec{v}\right\|
\left[\cos^{2}\left(\frac{\theta}{2}\right)
-

\sin^{2}\left(\frac{\theta}{2}\right)
\right] \\

=
\left\|\vec{u}\right\| \left\|\vec{v}\right\| \cos\left(\theta\right)
$$
This dot product by itself is already interesting when written in terms of the eigen-vectors \(\mathbf{X}^{\left(\phi_{\parallel}\right)}_{\parallel}\) and \(\mathbf{X}^{\left(\phi_{\perp}\right)}_{\perp}\) due to the introduction of the negative sign in front of the term corresponding to the perpendicular components.

Of course, by inspection this makes perfect sense. That is, we would usually say the unit vector for the perpendicular components point toward each other.

However, to be more rigorous, one needs to find the relationship between the eigen-vectors of \(\mathbf{R}^{3}_{\perp}\left(\phi_{\perp}\right)\) and how they relate to the rotation of the bisecting unit vector, \(\hat{B}_{\parallel}\).

As a prelude to further discussion, in physics, one might also be interested in how quickly such a rotation of the bisecting unit vector occurs.

Tuesday, March 6, 2012

Rotation Matrices (Cont.)

All of these rotation matrices have the same eigen-values:
$$
\lambda_{i}\in\{1,\pm i\}
$$
though they have different eigen-vectors:
$$
\mathbf{X}^{\left(\pm\right)}_{\hat{n}}=\frac{e^{\frac{i\pi}{4}}}{\sqrt{2}}
\begin{pmatrix}
e^{\frac{-i\pi}{4}}  & e^{\frac{-i\pi}{4}} &  0 \\
\mp e^{\frac{i\pi}{4}}  & \pm e^{\frac{i\pi}{4}}  & 0 \\
0  & 0 &  \sqrt{2}e^{\frac{-i\pi}{4}}
\end{pmatrix} \\
$$
$$
\mathbf{X}^{\left(\pm\right)}_{\parallel}=\frac{e^{\frac{i\pi}{4}}}{\sqrt{2}}
\begin{pmatrix}
0  & 0 &  \sqrt{2}e^{\frac{-i\pi}{4}} \\
\pm e^{\frac{-i\pi}{4}}  & \pm e^{\frac{-i\pi}{4}} &  0 \\
- e^{\frac{i\pi}{4}}  &  e^{\frac{i\pi}{4}}  & 0
\end{pmatrix} \\
$$
$$
\mathbf{X}^{\left(\pm\right)}_{\perp}=\frac{e^{\frac{i\pi}{4}}}{\sqrt{2}}
\begin{pmatrix}
e^{\frac{-i\pi}{4}}  & e^{\frac{-i\pi}{4}} &  0 \\
0  & 0 &  \sqrt{2}e^{\frac{-i\pi}{4}} \\
\pm e^{\frac{i\pi}{4}}  & \mp e^{\frac{i\pi}{4}}  & 0
\end{pmatrix}
$$
What's interesting is assigning some sort of coordinate system to these eigen-vectors. For example, one could say that the third eigen-vector of the set of eigen-vectors for \(\mathbf{X}^{\left(\pm\right)}_{\hat{n}}\) corresponds to \(\hat{z}\), that is to say:
$$
\mathbf{X}^{\left(\pm\right)}_{\hat{n}}= \begin{pmatrix}
0\\
0\\
1
\end{pmatrix}=\hat{z}
$$
$$
\mathbf{X}^{\left(\pm\right)}_{\perp}= \begin{pmatrix}
0\\
1\\
0
\end{pmatrix}=\hat{y}
$$
$$
\mathbf{X}^{\left(\pm\right)}_{\parallel}= \begin{pmatrix}
1\\
0\\
0
\end{pmatrix}=\hat{x}
$$
But, you may ask yourself, we have other eigen-vectors, what about those? What do they correspond to? Or, more importantly, what can I use them for?

Well, that's the part that's interesting. I've run out of time and will continue this later tonight.
P.S. Finding the eigen-vectors and eigen-values is easily verified with qtoctave or other linear algebra software.

A=[0,-1,0;1,0,0;0,0,1]
det(A)
eig(A)
[EVECT,EVAL]=eig(A)
A=[0,1,0;-1,0,0;0,0,1]
det(A)
eig(A)
[EVECT,EVAL]=eig(A)
A=[1,0,0;0,0,-1;0,1,0]
det(A)
eig(A)
[EVECT,EVAL]=eig(A)
A=[1,0,0;0,0,1;0,-1,0]
det(A)
eig(A)
[EVECT,EVAL]=eig(A)
A=[0,0,1;0,1,0;-1,0,0]
det(A)
eig(A)
[EVECT,EVAL]=eig(A)
A=[0,0,-1;0,1,0;1,0,0]
det(A)
eig(A)
[EVECT,EVAL]=eig(A)

Rotation Matrices

So I recently took interest in having fun with rotation matrices by analyzing two vectors, their inner products, their cross products, and their bisecting vectors after my previous post. Basically, the rotation matrices I am interested in are:
$$
\mathbf{R}^{3}_{\hat{n}}\left(\pm\frac{\pi}{2}\right)=

\begin{pmatrix}
0 & \mp 1 & 0 \\
\pm 1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}\\
\mathbf{R}^{3}_{\parallel}\left(\pm\frac{\pi}{2}\right)=

\begin{pmatrix}
1 & 0 & 0 \\
0 & 0 & \mp 1\\
0 & \pm 1 & 0
\end{pmatrix}\\

\mathbf{R}^{3}_{\perp}\left(\pm\frac{\pi}{2}\right)=

\begin{pmatrix}
0 & 0 & \pm 1 \\
0 & 1 & 0\\
\mp 1 & 0 & 0
\end{pmatrix}


$$
I'ts kinda late, so I'll finish explaining why this is interesting tomorrow.

Monday, March 5, 2012

Rotations: transformations that preserve length of and angle between, at least, two vectors

Wikipedia has a nice article on the SO(3) group where they start by stating that:
Rotation Group SO(3)
"length-preserving transformation in R3 preserves the dot product, and thus the angle between vectors"
They then continue by stating that:
$$
\vec{u}\cdot\vec{v} =
\frac{1}{2}\left(
  \left\|\vec{u} + \vec{v}\right\|^{2} - \left\|\vec{u}\right\|^{2} - \left\|\vec{v}\right\|^{2}
\right)
$$
However, the reader may not be aware of the fact that:
$$
\vec{u}\cdot\vec{v} = \left\|\vec{u}\right\|\left\|\vec{v}\right\|\cos\left(\theta\right)
$$
or

$$
 \cos\left(\theta\right)=\frac{\vec{u}\cdot\vec{v}}{\left\|\vec{u}\right\|\left\|\vec{v}\right\|}
$$

where one can explicitly see that, by definition of the dot product, if the coordinate system of \(\vec{u}\) and \(\vec{v}\) undergoes any rotation,  where the dot product is conserved, and we know that the lengths of \(\vec{u}\) and \(\vec{v}\) are conserved, then the angle \(\theta\), that is the angle \(\angle uOv\), can not change and is, therefore, also conserved.

(Really, when I saw that Wikipedia ignored readers that didn't know the definition of the dot (inner) product, I felt this was just a good excuse to play with latex in blogger. Though it left me wanting to be able to post graphs & vector diagrams in my blog, a la LaTeX.)

A more physical example.

Another example:
$$\hat{H}\left|\Psi\right>=i\hbar\partial_{t}\left|\Psi\right>$$
Schrödinger Equation  by Erwin Schrödinger
$$\hat{H}\left|\Psi\right>=i\hbar\partial_{t}\left|\Psi\right>$$
I am really looking forward to having fun with this blog :-D.

Sunday, March 4, 2012

Adding Latex Math to blogger.

I have been randomly checking how to add math to my blogger page in hopes of better communicating with readers. I recently came upon a link that uses www.watchmath.com to accomplish this task. The basic steps, as of this date to get this working are:

1. Add an HTML/JavaScript footer Gadget to the blog for interpretation of latex code in the document body.

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
http://www.mathjax.org/docs/1.1/start.html

2. If new to latex and ease of learning is important, you can include a WYSIWYG equation editor by adding another HTML/JavaScript footer.

<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script><p align="center" style="margin-top: 0; margin-bottom: 0"><font face="Arial">
Sample:
<a href="javascript:OpenLatexEditor('testbox','latex','')"> 
<img src="http://www.codecogs.com/gif.latex?\sum_{i=1}^{n}{(X_i - \overline{X})^2}" 
align="middle" /></a></font></p>
<p align="center" style="margin-top: 0; margin-bottom: 0"><b><font face="Arial">
<a href="javascript:OpenLatexEditor('testbox','latex','')"> 
Launch 
Editor</a></font></b></p>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<textarea id="testbox" rows="10" cols="20"></textarea></p>
<p align="center" style="margin-top: 0; margin-bottom: 0"> 
<a href="http://www.codecogs.com" target="_blank">
<img src="http://www.codecogs.com/images/poweredbycc.gif" border="0" 
title="CodeCogs - An Open Source Scientific Library" 
alt="CodeCogs - An Open Source Scientific Library" /></a>
<p style="margin-top: 0; margin-bottom: 0" align="center"><font size="1"><font face="Arial">
<a href="http://a2mstats.blogspot.com/">Aam Sudrajat</a></font> </font>
</p>


3. Thank the great folks over at MathJax, CodeCogs, watch math, and Aam Sudrajat's Blog for the tips. For formating code to a bloggable format see: http://formatmysourcecode.blogspot.com/

A brief example can be seen here: $$\alpha \beta \gamma$$
$$\alpha \beta \gamma$$

Update: There was an error with Aam's page and the solution can be found here: http://mytechmemo.blogspot.com/2012/02/how-to-write-math-formulas-in-blogger.html