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.