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

**URL:** <https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886>\
**Category:** Cesium for Unreal\
**Created:** [September 20, 2023, 10:47pm UTC](https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886 "2023-09-20T22:47:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RickB](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rickb/32/13301_2.png) [@RickB](https://community.cesium.com/u/RickB)\
**Post date:** [September 20, 2023, 10:47pm UTC](https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886/1 "2023-09-20T22:47:00Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [September 20, 2023, 11:05pm UTC](https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886/2 "2023-09-20T23:05:49Z")

</div>

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

> <https://github.com/CesiumGS/cesium/blob/132867c1c770c42003cb593bc6cfe259ec689d4f/packages/engine/Source/Core/EllipsoidRhumbLine.js#L482>

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.

---

<div class="post-metadata">

**Author:** ![RickB](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rickb/32/13301_2.png) [@RickB](https://community.cesium.com/u/RickB)\
**Post date:** [September 21, 2023, 2:18am UTC](https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886/3 "2023-09-21T02:18:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RickB](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rickb/32/13301_2.png) [@RickB](https://community.cesium.com/u/RickB)\
**Post date:** [September 22, 2023, 12:13am UTC](https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886/4 "2023-09-22T00:13:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [September 22, 2023, 1:21am UTC](https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886/5 "2023-09-22T01:21:27Z")

</div>

It’s not currently planned, sorry.

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [September 22, 2023, 1:22am UTC](https://community.cesium.com/t/from-an-origin-point-calculate-a-new-point-using-a-bearing-and-length/26886/6 "2023-09-22T01:22:24Z")

</div>

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.
