private static boolean sectorsRightAngleBeforeLastAngle(Heap<AngleInterval> endAngles, double lastAngle)
    {
        return !endAngles.isEmpty() && lastAngle > endAngles.peek().rightAngle && 
                (endAngles.peek().leftAngle < endAngles.peek().rightAngle || 
                    lastAngle < endAngles.peek().leftAngle);
    }