Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to calculate the distance between two points on the Eart

Status
Not open for further replies.

john168

Newbie level 6
Joined
Mar 17, 2004
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
174
geofence calculation

:cry: Please help me:
How to calculate the distance between two points on the Earth
I use pic16f77.
latitude and longitude of gps nmea0183.
my email:john168168@21cn.com

;-----------------------------------------------
Thank all

My design is tracing system,When car go out the Geo-fence area,the system will send message to Alarm Center.The Geo-fence types will be available:round and rectangular.The round area include two values:the original(latitude,longitude) and the radius(km).The rectangular area include two points(lat,long).
I need calculate that is car in the area? I need not exactitude calculate.

john
;----------------------------------------------
 

windsway geodesy

hi,
you should say what approximation you can accept.
There are many way to calculate that distance, for example you could use a spherical earth or, better, a ratational ellipsoid model of the Earth.

It is up to you.
regards
 

how to calculate fence radius between 2 points

Not especially for Up, but it can give you ideas:

**broken link removed**
 

pic16f77 geofence

john168,

you can find the mathematics you need here:
**broken link removed**

But I am really not shure if this is doable with a PIC.

I designed an 8051 based GPS logger years ago and programmed everything in assembler using the math routines from Intel 8051 basic which have 8 digit BCD precision ...

The PIC math routines have only 24 or 32 bit precision (including the mantissa) and I am afraid this is not enough for the great circle distance calculation, also you might get into trouble with the limited code space because floating point routines are very memory hungry.

If the distances you have to calculate are max. 20 Km you can assume the earth is flat and calculate the distance using good old Pythagoras :)

hope this helps and best wishes to your project
 

geofencing algorithms simple

Convert the Latitude/Longitude to UTM cordinates. Use the good old formula sqr(((x1-x2)^2)+((y1-y2)^2)). This will give you the distance in meters. But the mathematics involved may not work on limited RAM/Flash of pic. Search for mapstuff for a visual basic code.

. ' The original Visual Basic code is:
' mapstuff.bas version 0.92 released 06/25/2002
' geodesy.cls version 0.91 released 06/25/2002
'
' The initial developer of the Visual Basic code is < Victor Fraenckel>
' (vfraenc1@nycap.rr.com).
'
' Portions created by < Victor Fraenckel> are
' Copyright (C) 2002 < Windsway Instrument Company>.
'
'
' Obtained through:
'
' Windsway Instrument Company
 

distance between two points spherical earth c++

Thank all

My design is tracing system,
When car go out the Geo-fence area,the system will send message to Alarm Center.
The Geo-fence types will be available:round and rectangular.
The round area include two values:the original(latitude,longitude) and the radius(km).
The rectangular area include two points(lat,long).
I need calculate that is car in the area?

john
 

the eart longitudes

john168,

again if the distance is small (max 20Km) you can calculate with simple pythagoras method.

If a small error is acceptable you can use this method also for larger distances (maybe 100Km).

If you want to use a rectangular area you will just have to compare latitude and longitude with min and max values for your limits.

For a circular area you will have to use the distance furmulae but again you can simplify things by using pythagoras for small distances or if you accept a small error.

But doing this in a pic is not too simple as code space is very limited. Which programming language are you going to use (assembler, CCS C, Hi-Tech C or IAR C)?

hope this helps and best regards
 

calculating error between two points

C-man:
Thanks
I use assembler. Hope the code less 500 bytes.
John yin (China)
 

site:www.edaboard.com geofence calculation

Check out the Microchip Floating Point Routines here:
**broken link removed**

But I am afraid it will not be possible to implement what you want to do in 500 bytes of rom :-(

best regards
 

Re: geofence calculation

:cry: Please help me:
How to calculate the distance between two points on the Earth
I use pic16f77.
latitude and longitude of gps nmea0183.
my email:john168168@21cn.com

;-----------------------------------------------
Thank all

My design is tracing system,When car go out the Geo-fence area,the system will send message to Alarm Center.The Geo-fence types will be available:round and rectangular.The round area include two values:the original(latitude,longitude) and the radius(km).The rectangular area include two points(lat,long).
I need calculate that is car in the area? I need not exactitude calculate.

john
;----------------------------------------------

Hi john,

I m also doing the similar task, I m searching for Geo-fencing rectangular method algorithm. Please help me
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top