\documentclass[12pt]{article} % BB Feb 16 2010.
\usepackage{epsfig}
\textheight 9.0in \textwidth  6.0in \topmargin -0.4in \headsep 0.4in  
\oddsidemargin  0.25in  \evensidemargin 0.25in  

\def\sqr#1#2{{\vcenter{\hrule height.#2pt
   \hbox{\vrule width.#2pt height#1pt \kern#1pt
   \vrule width.#2pt} \hrule height.#2pt}}}
\def\square{{\mathchoice\sqr64\sqr64\sqr{4.2}3\sqr{3.0}3}}
\def\undertext#1{$\underline{\smash{\hbox{#1}}}$}
\pagestyle{empty}

\begin{document}

\centerline{\bf Solution for assignment 27a and 27b.} \bigskip 

The orbit is given by
$$ p = r\,(1+e\,\cos\theta) $$
where
$$ r = |\vec{r}| = \sqrt{r_x^2+r_y^2+r_z^2}~~{\rm with}~~\vec{r}
  = r_x\hat{x}+r_y\hat{y}+r_z\hat{z} = \vec{r}_1-\vec{r}_2\,, $$
$$ p = \frac{L^2}{\mu\alpha}~~{\rm and}~~
  e = \sqrt{1+\frac{2\,E\,L^2}{\mu\,\alpha^2}}\,. $$
$2p$ is called the {\it latus rectum}, and $e$ {\it eccentricity}.
Their definitions involve the reduced mass $\mu$, the coupling
strength $\alpha$, the center of mass energy $E$ and the magnitude 
of the angular momentum $L$:
$$ \mu=\frac{m_1m_2}{m_1+m_2}\,,~~\alpha=G\,m_1m_2\,,~~
   E = \frac{\mu\,\vec{v}^{\,2}}{2} + U(r)\,,~~L = |\vec{L}|
   ~~{\rm with}~~\vec{L}=\mu\,\vec{r}\times\vec{v} $$
with $v=|\vec{v}|$, $\vec{v}=\vec{v}_1-\vec{v}_2$. Once $r$, $p$ and $e$
are calculated, we can solve for $\theta$:
$$ \frac{p}{r} - 1 = e\,\cos(\theta)\ \Rightarrow\
   \theta = \pm \cos^{-1}\left(\frac{p-r}{er}\right) $$
with $-\pi<\theta\le\pi$ where the sign is that of $\vec{r}_0\cdot\vec{v}_0$.
Numerical values are in the {\tt Kparameters.txt} file.
\end{document}
