# Geodesy: how to calculate the straight line distance between two locations, which is represented by longitude and latitude?

**URL:** <https://discourse.julialang.org/t/geodesy-how-to-calculate-the-straight-line-distance-between-two-locations-which-is-represented-by-longitude-and-latitude/19984>\
**Category:** Geo\
**Tags:** diffeq, gmt, geodesy\
**Created:** [January 23, 2019, 2:03pm UTC](https://discourse.julialang.org/t/geodesy-how-to-calculate-the-straight-line-distance-between-two-locations-which-is-represented-by-longitude-and-latitude/19984 "2019-01-23T14:03:11Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Post date:** [January 23, 2019, 5:33pm UTC](https://discourse.julialang.org/t/geodesy-how-to-calculate-the-straight-line-distance-between-two-locations-which-is-represented-by-longitude-and-latitude/19984/6 "2019-01-23T17:33:49Z")

</div>

Doesn’t harversine distance in the Distances package work?

```julia
using Distances
julia> l1 = (-27.468937, 153.023628)
julia> l2 = (-27.465933, 153.025900)
julia> haversine(l1, l2, 6372.8)
0.39054922275889736

```

I used it to calculate distances in an agricultural plot.

---

_[View the full topic](https://discourse.julialang.org/t/geodesy-how-to-calculate-the-straight-line-distance-between-two-locations-which-is-represented-by-longitude-and-latitude/19984)._
