Possible EllipsoidGeodesic Bug

Hi Cesium team.

I have been working with EllipsoidGeodesic, and found that if I put two points on exact opposite sides of the globe my page will crash.

I put the following code into Cesium Sand Castle and both lines that setEndPoints throw an error ‘Uncaught DeveloperError: geodesic position is not unique’

var temp = new Cesium.EllipsoidGeodesic();

temp.setEndPoints(new Cesium.Cartographic.fromDegrees(0, 0, 801), new Cesium.Cartographic.fromDegrees(, 0, 800));

//temp.setEndPoints(new Cesium.Cartographic(0, 0, 801), new Cesium.Cartographic(3.14159, 0, 800));

console.log(“face”);

Is this a bug? Or is this function not supposed to take points on opposite sides of the globe?

-Matt Rutherford

As currently implemented, this is the expected behavior. As I understand it, there are an infinite amount of lines that can be drawn from one point to the other if the lines are 180 degrees apart so it’s impossible for us to return you “the” answer. I assume we could return “an” answer in these cases, but I’m not sure what the problems/drawbacks of that would be. Maybe Dan or Path can chime in with more info.

Cesium implements the Vincenty algorithm which fails to converge for
points which are close to antipodal. It would be preferable to use
JavaScript code from my library, GeographicLib. For demonstations, see

http://geographiclib.sourceforge.net/scripts/geod-calc.html
http://geographiclib.sourceforge.net/scripts/geod-google.html

This implement the algorithm given in

This is more accurate than Vincenty and always converges.