# DistanceCalc : Calculate distance between two places from coordinates

Well…
I am here to present my first extension (ever) to this community.
As you have read in title DistanceCalc calculates distance (sometimes accurate) between two places from coordinates (latitudes and longitudes).

Blocks
Just a single block…

Usage
It has just one function/block as you can see in above screenshot.

It accepts four coordinates in format like lat1,lng1,lat2, and lng2 and all of them should be integers(double).It returns distance in KiloMetres.
But you can convert distance(Km) in different units by using some math blocks.
An example can be this:

Aia
Seriously???
Anyway,
Learn to use this ‘basic’ extension from this Aia:

Open Source
I want to make my extension open source so that beginners can learn from this.
Here is Java file:
DistanceCalc.java (2.0 KB)

Credits
I want to say thank you to @Souvik_Bera and @The_Developer_2.0 for video on YouTube and some useful posts in Community and @KodularCreator (of course) for such a great platform(as always).

Thank you…

I will be back with another extension and an amazing App

9 Likes

That’s a nice one. Which formula do you use to calculate the distance?

2 Likes

Congratulations brother. very nice extension and awsome start

2 Likes

Thank you

Haversine Formula.

Inspired from a KodeJam challenge

3 Likes

That was my first guess

For everybody who wants to read up on this formula

9 Likes

Secret is getting spoiled…
I am thinking to make it open source.
As I have learned to make extension from some open source extensions , it is my responsibility to do same.
It will be open source soon…

7 Likes

That’s great to make others learn from your code.

3 Likes

@vknow360 Nice start. Keep it up

5 Likes

I completed my promise.
Here is Java file:
DistanceCalc.java (2.0 KB)