Great circle distance

Sorry if this is a basic question but does the cesium plugin for unreal have a function to compute great circle distances?

I’m not aware of any functionality like this exposed through cesium-unreal blueprints (or in C++).

If you were looking to write this yourself in C++, you may be able to reference the code in CesiumGeospatial::SimplePlanarEllipsoidCurve. You’d still have to do a bit of work, as it doesn’t calculate any distances for you, but it is the class that the cesium-unreal FlyToComponent is built on.

It’s important to note that SimplePlanarEllipsoidCurve is an approximation of a great circle/geodesic. It should be good enough for most purposes, but if you’re looking for precise answers you’d need something like CesiumJS’s EllipsoidGeodesic class, which is implemented with a much more complicated (and computationally taxing) iterative solver: cesium/packages/engine/Source/Core/EllipsoidGeodesic.js at 1.115 · CesiumGS/cesium · GitHub. There’s no equivalent to it currently in Unreal, but it could definitely be added. Particularly, you’d want to port over the implementation of Vincenty’s inverse formula, which will give you the results you need: cesium/packages/engine/Source/Core/EllipsoidGeodesic.js at 1.115 · CesiumGS/cesium · GitHub

1 Like

Thank you all for the suggestions.

I’ll leave this feature for a future addition if it is asked for but I know now it isn’t trivial.