# Geodesic calculations in GMT

**URL:** <https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469>\
**Category:** Q&A\
**Created:** [November 19, 2022, 1:27pm UTC](https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469 "2022-11-19T13:27:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZMAlt](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/zmalt/32/4912_2.png) [@ZMAlt](https://forum.generic-mapping-tools.org/u/ZMAlt)\
**Post date:** [November 19, 2022, 1:27pm UTC](https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469/1 "2022-11-19T13:27:42Z")

</div>

Hello.  
Is there a solution to **direct** geodesic problem in GMT ?

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [November 19, 2022, 4:15pm UTC](https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469/2 "2022-11-19T16:15:56Z")

</div>

Yes it has, just not sure where without diving in the manuals. `project` is one place but it’s spherical approximation only. I’m sure we have functions that use Vincent’s algorithm but again, don’t know a pointer from top of my head.

And you may also be interested in this story that was quite discussed in this forum [https://www.generic-mapping-tools.org/GMTjl\_doc/tutorials/longest\_sail/longestsail/](https://www.generic-mapping-tools.org/GMTjl_doc/tutorials/longest_sail/longestsail/)

---

<div class="post-metadata">

**Author:** ![ZMAlt](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/zmalt/32/4912_2.png) [@ZMAlt](https://forum.generic-mapping-tools.org/u/ZMAlt)\
**Post date:** [November 20, 2022, 2:19am UTC](https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469/3 "2022-11-20T02:19:17Z")

</div>

> [@Joaquim](#):
>
> Yes it has, just not sure where without diving in the manuals. `project` is one place but it’s spherical approximation only. I’m sure we have functions that use Vincent’s algorithm but again, don’t know a pointer from top of my head.

I have noticed the usages of `project` module, but it is a bit inconvenient

```bash
$ gmt project -C0/0 -A45 -G100 -L0/100 -Q
-3.18055468146e-15	3.18055468146e-15	0
0.635941801416	0.635902632934	100

```

It requires -L option and cannot get a single point.

Also, I want an ellipsoid solution in GMT.

---

<div class="post-metadata">

**Author:** ![bwwjohnson](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bwwjohnson](https://forum.generic-mapping-tools.org/u/bwwjohnson)\
**Post date:** [December 12, 2022, 4:59pm UTC](https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469/4 "2022-12-12T16:59:16Z")

</div>

Hey, not sure if you’ve solved this yet, but gmt mapproject might be the thing you’re looking for… it has a -je option where you can specify the algorithm you want to use (including Vincenty).

> **[mapproject — GMT 6.5.0 documentation](https://docs.generic-mapping-tools.org/dev/mapproject.html)**

---

<div class="post-metadata">

**Author:** ![ZMAlt](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/zmalt/32/4912_2.png) [@ZMAlt](https://forum.generic-mapping-tools.org/u/ZMAlt)\
**Post date:** [December 13, 2022, 1:22am UTC](https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469/5 "2022-12-13T01:22:10Z")

</div>

Hello, there is only a sulution to the inverse geodesic problem in `mapproject`, i.e. get the azimuth and distance between two points.

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [January 5, 2023, 8:22am UTC](https://forum.generic-mapping-tools.org/t/geodesic-calculations-in-gmt/3469/6 "2023-01-05T08:22:19Z")

</div>

I’m sure you know, but [PROJ](https://proj.org/) includes the utility [geod](https://proj.org/apps/geod.html) which can calulate the inverse and direct problem. Take a look at the [examples](https://proj.org/apps/geod.html#examples).
