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


ssclib (ssclib-4.33) [xmmsas_20190531_1155-18.0.0]

Is a given point inside a given ellipse?

Two routines are given for the two ellipse formats described above:

  function pointInEllipseWithPhase(x, y, xAmp, yAmp, phase)
    real(single), intent(in) :: x, y, xAmp, yAmp, phase
    integer :: pointInEllipseWithPhase
  end function pointInEllipseWithPhase

  function pointInEllipseWithAngle(x, y, xSemiAxis, ySemiAxis, rotatedAngle)
    real(single), intent(in) :: x, y, xSemiAxis, ySemiAxis, rotatedAngle
    integer :: pointInEllipseWithAngle
  end function pointInEllipseWithAngle

These functions return -1 if the point (x, y) lies fully within the ellipse; 0 if it is on the border; and 1 if it is fully outside the ellipse.



XMM-Newton SOC/SSC -- 2019-06-02