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


ssclib (ssclib-4.36.1) [xmmsas_20230412_1735-21.0.0]

Generating a set of points along an ellipse locus

  subroutine calcEllipseFromAngle(xSemi, ySemi, angleDeg, xVals, yVals)
    real(single), intent(in)  :: xSemi, ySemi, angleDeg
    real(single), intent(out) :: xVals(:), yVals(size(xVals))
  end subroutine calcEllipseFromAngle

Equation 2 can be decomposed into the following pair of parametric equations in $theta$:

$\displaystyle x = R_x \cos(\theta)
$
$\displaystyle y = R_y \sin(\theta).
$

$theta$ here plays the same role as in equations 3 and 4. The subroutine returns points evenly distributed in $theta$.

The matching `phase'-style subroutine is

  subroutine calcEllipseFromPhase(xAmp, yAmp, phase, xVals, yVals)
    real(single), intent(in)  :: xAmp, yAmp, phase
    real(single), intent(out) :: xVals(:), yVals(size(xVals))
  end subroutine calcEllipseFromPhase

Again the point coordinates returned in xVals and yVals are distributed evenly in $theta$.



XMM-Newton SOC -- 2023-04-16