Distance Calculation by Lattitude/Longitude

Status
Not open for further replies.
Hassan... depending on the number ie.. 33.3333 (worst case) a 32bit float will be truncated to 4 or 5 decimal places... Do you know how IEEE 32 float works?
 
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..
 
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..
 
Just what is the application? Why do you need extreme accuracy?

A lot of the calculations can be simplified unless you are looking for meter accuracy in distances of hundreds of meters.
 
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.
 
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
 
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
 
What is the maximum range that you need? Do you need 50m accuracy if the distance is 100 km?
 
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.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…