XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


ssclib (ssclib-4.30) [xmmsas_20160201_1833-15.0.0]

Routines which deal with Routines which deal with Is a given point Home Index

Meta Index / Home Page / Routines which deal with

`Rotated' and `phase' formats

Dealing with ellipses is complicated by the fact that there are at least two convenient ways to parameterise an ellipse, which I will call the `rotated' and `phase' forms. In the `rotated' form the ellipse is specified by two semiaxes $R_x$ and $R_y$ and a an angle of rotation $\alpha$. In these terms the ellipse is specified most transparently by three equations:


\begin{displaymath}
\frac{x_0^2}{R_x^2} + \frac{y_0^2}{R_y^2} = 1
\end{displaymath} (2)


\begin{displaymath}
x = x_0 \cos(\alpha) - y_0 \sin(\alpha)
\end{displaymath}


\begin{displaymath}
y = y_0 \cos(\alpha) + x_0 \sin(\alpha).
\end{displaymath}

The ellipse in `phase' format is specified by two amplitudes $A_x$ and $A_y$ and a phase $phi$ by two parametric equations in $theta$ as follows:


\begin{displaymath}
x = A_x \cos(\theta)
\end{displaymath} (3)


\begin{displaymath}
y = A_y \cos(\theta + \phi).
\end{displaymath} (4)

If an ellipse is thought of as a squashed circle, $theta$ is the angle around the original circle.

Rotations of coordinate system are easily accommodated in the `rotated' format; changes of aspect ratio of the coordinate system are better accommodated in the `phase' format.

Subroutines are given for translating between the two formats:

  subroutine ellipsePhaseToAngle(xAmp, yAmp, phase&
    , shortSemiAxis, longSemiAxis, rotatedAngle)

    real(single), intent(in)  :: xAmp, yAmp, phase
    real(single), intent(out) :: longSemiAxis, shortSemiAxis, rotatedAngle
  end subroutine ellipsePhaseToAngle

  subroutine ellipseAngleToPhase(shortSemiAxis, longSemiAxis, rotatedAngle&
    , xAmp, yAmp, phase)

    real(single), intent(in)  :: longSemiAxis, shortSemiAxis, rotatedAngle
    real(single), intent(out) :: xAmp, yAmp, phase
  end subroutine ellipseAngleToPhase


Routines which deal with Routines which deal with Is a given point Home Index

XMM-Newton SOC/SSC -- 2016-02-01