Lats and Lons
Archiver
Posts: 46,084
Hi all
Given the limitations of no floating point math, does anyone know of a way
to calculate distance between to sets of lats/lons say to the nearest
kilometer?
Regards, Peter
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
[noparse][[/noparse]Non-text portions of this message have been removed]
Given the limitations of no floating point math, does anyone know of a way
to calculate distance between to sets of lats/lons say to the nearest
kilometer?
Regards, Peter
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
manager@s... writes:
> Given the limitations of no floating point math, does anyone know of a way
> to calculate distance between to sets of lats/lons say to the nearest
> kilometer?
>
Are you talking Great Circle or straight-line distances?
Sid Weaver
W4EKQ
Port Richey, FL
[noparse][[/noparse]Non-text portions of this message have been removed]
Sorry.
Regards, Peter
Original Message
From: Newzed@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=GSz77USflxBzl3kDHqNv1qgRWyZemSLqTImDsn2z94I9TVy2v9E2UpU69W9K2-VmU9QFUw]Newzed@a...[/url
Sent: Thursday, August 14, 2003 11:11 PM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Lats and Lons
In a message dated 8/14/2003 6:51:20 AM Eastern Standard Time,
manager@s... writes:
> Given the limitations of no floating point math, does anyone know of a
> way to calculate distance between to sets of lats/lons say to the
> nearest kilometer?
>
Are you talking Great Circle or straight-line distances?
Sid Weaver
W4EKQ
Port Richey, FL
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
[noparse][[/noparse]newly documented] HYP function will help you. Knowing the X and Y
offset between two points, it will tell you the distance between them.
-- Jon Williams
-- Parallax
Original Message
From: Peter May [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=GMncyvdfuUYRjfyFrQmq_KF0EdQxwC3gRwMxMDEprGfJaE-zto0lj0LIam2e7sU5-C8VHc9I1bscOuWwDLI]manager@s...[/url
Sent: Thursday, August 14, 2003 8:26 AM
To: 'basicstamps@yahoogroups.com'
Subject: RE: [noparse][[/noparse]basicstamps] Lats and Lons
Straight line.
Sorry.
Regards, Peter
Original Message
From: Newzed@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=098QJMi9LNKS8wmDcWjBeZ-VyVEoAI3pCeJR53Q9yeIQykd1UhD7NQPdSuxVGEY9tfXjEPC7]Newzed@a...[/url
Sent: Thursday, August 14, 2003 11:11 PM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Lats and Lons
In a message dated 8/14/2003 6:51:20 AM Eastern Standard Time,
manager@s... writes:
> Given the limitations of no floating point math, does anyone know of a
> way to calculate distance between to sets of lats/lons say to the
> nearest kilometer?
>
Are you talking Great Circle or straight-line distances?
Sid Weaver
W4EKQ
Port Richey, FL
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
>
> Hi all
>
> Given the limitations of no floating point math, does anyone know of a way
> to calculate distance between to sets of lats/lons say to the nearest
> kilometer?
A good approximation of distance and course, in mid-latitudes,
for distances > 1200 miles or so...
Compute the absolute difference between Latitudes & Longitudes
Lat1 41d 26'N Lon1 71d 23'W (Brenton Reef Light, off
R.I.)
Lat2 32d 22'N Lon2 64d 39'W (St.David's Light, Bermuda)
DLat 9d 04'S = 544' DLon 6d 44'E = 404'E
Compute the absolute difference of DLat/2 and Lat1
1/2 DLat 4d 32'S
Lat1 41d 26'N
Lm 36d 54'N
p = DLon x cos Lm
= 404 x cos 36d 54'
= 323 miles
tan Course = p / DLat
= 323 / 544 = .594 = S 30d 42'E
so the true course is 180d - 30d 42' = 149d 18'E
and distance is Dlat / cos Course, so
d = 544' / cos 30d 42'
= 633 miles
Seems to me this could be turned into STAMPlish, though I have'nt
tried. Accuracy is good enough for sailboat navigation - You cruise
missile guys will have to look elsewhere.
Jack
> for distances > 1200 miles or so...
Should be " < 1200 miles ", of course.
Jack
the online help. Be sure to download the latest Beta compiler so that
you have the most up-to-date docs. As soon as the compiler is finalized
we will move the new online information to our printed manual.
-- Jon Williams
-- Parallax
Original Message
From: goflo@p... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=HgsdRsISTZv0Ch8HU-ylECWus2MxKEI2efIGoyJJQq6EU0Gl7GsSWC3h3-FqndBIwkRBvSMVtSK5pg]goflo@p...[/url
Sent: Thursday, August 14, 2003 10:22 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Lats and Lons
Jon Williams wrote:
> ... the [noparse][[/noparse]newly documented] HYP function ...
Hi Jon -
Where are the new function docs?
thanks, Jack
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
> ... the [noparse][[/noparse]newly documented] HYP function ...
Hi Jon -
Where are the new function docs?
thanks, Jack