NaN produced when dealing with flat ellipses
When attempting to project a point on a 2D ellipse, the algorithm sometimes fails and produces NaN. This seems to be happen on flat ellipses, where the ellipse evolute extends far outside the ellipse itself along the minor axis. The initial point in the iterations generates a line that does not intersect the ellipse at all.
The following test case reproduces the bug.
@Test
public void testFlatEllipse() {
final double a = 0.839;
final double b = 0.176;
final Ellipse ellipse = new Ellipse(Vector3D.ZERO, Vector3D.PLUS_I, Vector3D.PLUS_J,
a, b, FramesFactory.getGCRF());
final Vector2D close = ellipse.projectToEllipse(new Vector2D(2.0, 4.0));
Assert.assertEquals(1.0,
close.getX() * close.getX() / (a * a) + close.getY() * close.getY() / (b * b),
1.0e-10);
}