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


ssclib (ssclib-4.36.1) [xmmsas_20230412_1735-21.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 -- 2023-04-16