# Calculate distance travelled

**URL:** <https://community.thunkable.com/t/calculate-distance-travelled/565278>\
**Category:** Questions about Thunkable X\
**Created:** [May 11, 2020, 8:23am UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278 "2020-05-11T08:23:20Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![eko.devs.apploroceo](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eko.devs.apploroceo/32/93147_2.png) [@eko.devs.apploroceo](https://community.thunkable.com/u/eko.devs.apploroceo)\
**Post date:** [April 6, 2021, 3:42pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/24 "2021-04-06T15:42:05Z")

</div>

pls create another topic for it

---

<div class="post-metadata">

**Author:** ![aanshi6](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/aanshi6/32/101076_2.png) [@aanshi6](https://community.thunkable.com/u/aanshi6)\
**Post date:** [April 6, 2021, 3:42pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/25 "2021-04-06T15:42:43Z")

</div>

I did and no one replied, so I thought maybe someone here could help

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [April 6, 2021, 4:50pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/26 "2021-04-06T16:50:53Z")

</div>

you got you lat long assignments reversed:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/d/5d581e5fe834690f2367e3c3b40d8c7d5c002363.png)

---

<div class="post-metadata">

**Author:** ![delee\_techdeveloper](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/delee_techdeveloper/32/29616_2.png) [@delee\_techdeveloper](https://community.thunkable.com/u/delee_techdeveloper)\
**Post date:** [August 19, 2021, 1:54am UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/27 "2021-08-19T01:54:28Z")

</div>

Hey I’m still lost at his part, did you figure it out to be successful?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [August 19, 2021, 2:12am UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/28 "2021-08-19T02:12:26Z")

</div>

This is a long topic at this point so I’m not sure which post you’re referring to but I can tell you that I used this formula in Thunkable and it works great. It’s fast and accurate. But it took something like 100 blocks to set it up and it took me a LONG time to double-check everything to make sure the math was correct.

It’s much easier to just plug the formula into a Google Sheet and reference the result from Thunkable but I decided I wanted the processing to happen within the app so I built it all using Thunkable blocks.

---

<div class="post-metadata">

**Author:** ![vishruth-ram](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vishruth-ram](https://community.thunkable.com/u/vishruth-ram)\
**Post date:** [August 22, 2021, 9:12am UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/29 "2021-08-22T09:12:57Z")

</div>

guys, I don’t know what you have done.

 ![Screenshot 2021-08-22 140940](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/7/b78af300e445226bceace2f787ad500671bca0bb.png)

> function (get place){

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [August 23, 2021, 5:37am UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/30 "2021-08-23T05:37:06Z")

</div>

Is this a solution? Or did you have a question about those blocks?

---

<div class="post-metadata">

**Author:** ![vishruth-ram](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vishruth-ram](https://community.thunkable.com/u/vishruth-ram)\
**Post date:** [August 24, 2021, 4:33am UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/31 "2021-08-24T04:33:55Z")

</div>

I mean `null` value is returned by the `dlon variable` which in sense return `value ` to others. by the function is not supported

> **fucntion**
>
> dlon-other-dlon+null

 ![Screenshot 2021-08-22 140940](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/7/b78af300e445226bceace2f787ad500671bca0bb.png)

> function (get place){

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [November 7, 2023, 5:13pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/33 "2023-11-07T17:13:54Z")

</div>

follow this thread

> [@Calculate distance travelled](https://community.thunkable.com/t/calculate-distance-travelled/565278/2):
>
> this small app solves the haversine formula for calculating the APPROXIMATE distance between 2 points expressed in latitude and longitude degrees. currently it’s set to return miles. if you want kilometers, change the factor 3961 to 6373 [https://x.thunkable.com/copy/0b2e0a3c8da1a36488f062715bf5e263](https://x.thunkable.com/copy/0b2e0a3c8da1a36488f062715bf5e263)

---

<div class="post-metadata">

**Author:** ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)\
**Post date:** [December 24, 2023, 4:48pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/34 "2023-12-24T16:48:27Z")

</div>

Hey Manyone

Question

In the code vs the google sheet function

The end result in miles doesn’t match.

I started a post about it.

Everything matches up until the 180/PI

Thoughts

---

<div class="post-metadata">

**Author:** ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)\
**Post date:** [December 24, 2023, 6:22pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/35 "2023-12-24T18:22:09Z")

</div>

Hey Hey Everyone,

Little help.

I must be missing something. This did work at one point about a month ago.

Here is the Havesine sample I put together. The google sheet says one thing and the app says another. I have mapped out all variables up to D. D is off.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/8/d8d7634f3bc7587f1484d0ca2f6aefbd5b65c3b9.png)

[https://x.thunkable.com/projects/6587784c856ddf4fb5cabc7d/1bcce8b7-3d25-409a-93b8-75deecebd725/blocks](https://x.thunkable.com/projects/6587784c856ddf4fb5cabc7d/1bcce8b7-3d25-409a-93b8-75deecebd725/blocks)

---

<div class="post-metadata">

**Author:** ![cresto.pgaxq2](https://avatars.discourse-cdn.com/v4/letter/c/8edcca/32.png) [@cresto.pgaxq2](https://community.thunkable.com/u/cresto.pgaxq2)\
**Post date:** [December 24, 2023, 6:23pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/36 "2023-12-24T18:23:42Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/7/f73870f470490a968538c6a6ae1431eabfa154e8.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 24, 2023, 7:40pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/37 "2023-12-24T19:40:49Z")

</div>

Anyone responding, please comment on the topic that has already been created for this issue (link below). We now have three topics by @cresto.pgaxq2 that are being updated for this single issue which causes extra work for people who have to go back and read through multiple threads.

Original topic: [Haversine Formulas (Or ACOS/COS/SINor SQT) Not functioning with Sensor Location](https://community.thunkable.com/t/haversine-formulas-or-acos-cos-sinor-sqt-not-functioning-with-sensor-location/2753592)

Keeping everything in a single topic is more efficient for the community. I know you’re wanting answers, @cresto.pgaxq2, and hopefully what I posted in your original topic is helpful or can spur additional help from others.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 24, 2023, 7:40pm UTC](https://community.thunkable.com/t/calculate-distance-travelled/565278/38 "2023-12-24T19:40:54Z")

</div>

Closed on December 24, 2023, 7:40pm UTC



[Previous page](https://community.thunkable.com/t/calculate-distance-travelled/565278.md?page=1)
