\documentclass[psfig,preprint]{aastex}
\usepackage{graphicx}
\usepackage[verbose]{wrapfig}
\begin{document}
\tolerance=10000
\def\simlt{\lower.5ex\hbox{$\; \buildrel < \over \sim \;$}}
\def\simgt{\lower.5ex\hbox{$\; \buildrel > \over \sim \;$}}

\title{HOW TO CREATE A PERSPECTIVE PROJECTION IN IDL}
Do the following:
\begin{enumerate}
\item Decide where you want the pole of your projection to be. You can
    define the center in terms of Galactic or equatorial
    coordinates; we'll talk in terms of Galactic coordinates here as an
    example. Let the Galactic coordinates of your perspective pole be
    $(gl_{pole}, bg_{pole})$.

    Your projection pole defines a new spherical coordinate
    system. A particular position in Galactic coordinates is specified
    by $(gl,gb)$ and in your new system it is specified by the angles
    $(long,lat)$. Given $(gl,gb)$, you must find $(long,lat)$ using a
    proper spherical coordinate transformation using the rotation matrix
    ${\bf rot}$ that relates your projection to the Galactic one.

To determine the rotation matrix ${\bf rtot}$, use our procedure

    {\tt rmatrix, gl\_pole, gb\_pole, rtot}

\item For your particular point, we have our coordinate
  conversion procedure

    {\tt sph\_coord\_conv, gl, gb, rtot, long, lat}
    
\item The perspective projection represents the your particular
  position's angular coordinates $(long,lat)$ in terms of linear
  coordinates on the projection plane $x$ and $y$, whose origin is the
  pole of your projection. The origin has sky coordinates
  $(gl_{pole},bg_{pole})$. It's conceptually simpler to think of the
  projection plane in terms of polar coordinates $R$ and $\theta$, where
  as usual $R=(x^2+y^2)^{1/2}$ and $\theta = {\rm atan}(y/x)$. Then $R$
  is uniquely related to $lat$ and $\theta$ to $long$.

  For a stereographic projection, 
%
  \begin{equation} \label{stereo}
    R = \tan \left( {90.-lat \over 2} \right)
  \end{equation}
  %
  and
  \begin{equation}
    \theta = long \ + \ longoffset
    \end{equation}

where $longoffset$ is a zero point of your own choosing and is a keyword
in {\tt rmatrix}; you can leave it equal to zero. For a gnomic
projection, replace equation \ref{stereo} by 

%
  \begin{equation} \label{gnomic}
    R = \tan ( 90.-lat )
  \end{equation}
  %
\noindent For these, you can use our procedure {\tt stereographic.pro} .

\end{enumerate}

\end{document}

