Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Distance Calculation by Lattitude/Longitude

Status
Not open for further replies.
well i dont know about IEEE float :(.... i just want to calculate distance by using GPS coordinates and microcontroller is unable to calculate i think due to trunctation
 
Point is... your accuracy isn't achievable with 32bit float.. We need a work round, certain calculation must be done using fixed point maths.. Has the equation been posted...or can you post it now..
 
here is formula
on calculator it works fine
 

Attachments

  • distannnce.jpg
    distannnce.jpg
    155.1 KB · Views: 124
Ok.. The accuracy required..

100 km due north equates to 0.8992336
100km + 1 metre due north = 0.8992426
100km + 250mm due north = 0.8992358

1 metre accuracy needs 5 decimal places and 100mm requires 6 decimal places

You are definitely going to need 64bit double precision as just the long / lat division alone yeilds 4-5 bit precision .. I have done the basic calculations using fixed
but my fixed cos / sine are only good for 3 decimals..
 
i need atleast 50 meters accuracy because in my project i have to display the distance of object from the station,station is 80meter(max) far from moving object. .... i am using rf modules for communication.
 
Quote Originally Posted by hssn601 View Post
so what i have to doo?? 64 bit float is not available
Write your own maths rotuines?.
can you please give me a link where i can find help how to write math routines.
thanks.
 
Ian Rogers
GPS units are only accurate to 1/2 metres to start with.. But if you need to display a distance up to 80 metres then you would need 1 or 2 metres
Sorry dont get what you say because of my bad english :(
 
i need 5m accuracy and distance is about 80 meters

Now THAT was the information you should have written in post #1 and saved everyone lots of wasted time. :( People were giving you globe calculations when all you need is the most basic grid calculation.

You said; "station is 80meter(max) far from moving object"
Is this another "car following car" project that needs the distance between moving cars?

You should say now more info about the project, like if both the station AND object are moving.

At least 5m accuracy and 80m max makes things very simple.
 
each node is 80m away from each other and only bus is moving
 

Attachments

  • block.png
    block.png
    32.1 KB · Views: 116
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top