From an origin point, calculate a new point using a bearing and length

I am no mathematician so this is a bit of a stretch for me.

I have a given StartPoint. It’s perfectly placed in a Cesium world.
What I need is an EndPoint.

To calculate the EndPoint, I have two values.

  • A distance from StartPoint
  • A bearing from StartPoint

Is there an existing cesium function that will help me calculate this EndPoint? Or is there an easy to understand forumula?

Thanks all!

1 Like

There’s nothing in Cesium for Unreal to do that, but CesiumJS has such a function that you could port to C++:

In CesiumJS, a Cartographic is a longitude/latitude/height where longitude and latitude are in radians (not degrees!). Heading is the angle (again, in radians!) from North (I think!). Distance is in meters.

Hi Kevin, thanks! I’ll check it out.

Yeah, that got pretty intense pretty quick. There is a lot to try and digest out of all that, lot of terms that I’m not overly familiar with. Any chance that you guys are going to add this functionality to the UE code base anytime soon?

It’s not currently planned, sorry.

I’m sure there are existing C++ libraries that can do this computation if you look around a bit. I’m not familiar with any offhand, though.