comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: [Q]: How to calculate distance from GPS measurements

Re: [Q]: How to calculate distance from GPS measurements
type: item
description: Vince Scullin wrote: > > I am working on a project where I will be receiving measurements from the Global > Positioning System, presumably latitude and longitude measurements, and I will > need to calculate the distances between the measurement points. The measurements > will all be taken over a region of only a few miles so I guess I could assume > the earth is flat over this region and just calculate the straight line > distance. But I was wondering if anyone could help me with a more mathematically > rigorous method for calculating distance from pairs of latitude/longitude > measurements? I converted this from FORTRAN to IDL. It was sent to me by someone on the net whose name I don't recall. It has some sort of reference you could try and look up. Note that I did not try to optimize the loop. PRO eqldaz, eth, eph, th, phi, n, xdeg, dis, az ;+ ; Purpose: ; EQLDAZ calculates the distance (degrees and km) and azimuth ; between a position in decimal degrees (ETH latitude, EPH longitude), ; and an array of N decimal lat (TH) and long (PHI) positions. ; All input positions are in geographic coordinates which are ; converted to equidistant latitude coordinates for all internal ; calculations using the method of Brown (1984). ; The first-order great-ellipse correction is applied (equation (36)). ; Author: DRHO (using the results of Brown (1984) GJRAS, 445.) ; input: ; double eth initial latitude (degrees, N+) ; double eph initial longitude (degrees, E+) ; double th(n) array of latitudes (degrees, N+) ; double phi(n) array of longitudes (degrees, E+) ; integer n number of points array ; output: ; double xdeg distance between points (degrees) ; double dist distance between points (kilometers) ; double az azimuth from initial point (degrees) ;- xdeg = dblarr(n) dis = dblarr(n) az = dblarr(n) RADCO = 1.745329251994329D-02 DEGCO = 57.29577951308232D0 FLATTN = 1.D0/298.257D0 ONFLAT = 1.D0 - FLATTN ELLIP0 = 1.001119D0 ELLIP1 = 0.001687D0 DEGKM = 111.19504D0 PIO2 = RADCO*90.D0 ;…
creator: Liam Gumley
date: 1996-03-22T08:00:00-00:00