Click here to Skip to main content
15,919,245 members
Home / Discussions / Algorithms
   

Algorithms

 
JokeOf course straight line... Pin
CPallini29-Oct-07 4:24
mveCPallini29-Oct-07 4:24 
GeneralRe: Of course straight line... Pin
El Corazon29-Oct-07 10:22
El Corazon29-Oct-07 10:22 
AnswerRe: Distance between two GPS points. Pin
El Corazon29-Oct-07 10:22
El Corazon29-Oct-07 10:22 
AnswerRe: Distance between two GPS points. Pin
David Crow1-Nov-07 9:45
David Crow1-Nov-07 9:45 
GeneralRe: Distance between two GPS points. Pin
chandu0042-Nov-07 3:22
chandu0042-Nov-07 3:22 
GeneralRe: Distance between two GPS points. Pin
El Corazon2-Nov-07 10:29
El Corazon2-Nov-07 10:29 
AnswerRe: Distance between two GPS points. Pin
Reagan Conservative2-Nov-07 10:00
Reagan Conservative2-Nov-07 10:00 
AnswerRe: Distance between two GPS points. Pin
RichardM112-Nov-07 13:33
RichardM112-Nov-07 13:33 
the easiest way to do it (assuming spherical earth)is to convert the lat-lon values into X-Y-Z values.
The center of the earth is (0,0,0),
the intersection of the prime meridian and the equator is (R,0,0)
lat 0, lon +90 is (0,R,0),
the north pole is (0,0,R)
the south pole is (0,0,-R)

where R = radius of earth

to go from lat lon to x y z is:
x = R * Cos(lon) * Cos(lat)
y = R * Sin(Lon) * Cos(lat)
z = R * Sin(lat)

You do that for point 1 and point 2, then determine the distance between them (straight line)
x' = x2-x1
y' = y2-y1
z' = z2-z1

d = sqrt((x'*x')+(y'*y')+(z'*z'))

One half of the angle from point 1 to point 2 is

a = ArcSin(d/2R)

to get the great circle distance take this angle (in radians), double it to get the actual angle, them multiply if by the radius of the earth

D = 2 * a * R

where D is the distance you are looking for.
QuestionApproximating free hand curve to Beizer Pin
jk chan28-Oct-07 16:26
jk chan28-Oct-07 16:26 
AnswerRe: Approximating free hand curve to Beizer Pin
CPallini29-Oct-07 0:46
mveCPallini29-Oct-07 0:46 
GeneralRe: Approximating free hand curve to Beizer Pin
jk chan29-Oct-07 1:05
jk chan29-Oct-07 1:05 
GeneralI'm a newcomer Pin
yuneiv28-Oct-07 4:18
yuneiv28-Oct-07 4:18 
GeneralRe: I'm a newcomer Pin
User 171649228-Oct-07 10:34
professionalUser 171649228-Oct-07 10:34 
GeneralRe: I'm a newcomer Pin
Paul Conrad28-Oct-07 11:55
professionalPaul Conrad28-Oct-07 11:55 
GeneralRe: I'm a newcomer Pin
yuneiv28-Oct-07 16:38
yuneiv28-Oct-07 16:38 
GeneralRe: I'm a newcomer Pin
Paul Conrad28-Oct-07 16:52
professionalPaul Conrad28-Oct-07 16:52 
GeneralRe: I'm a newcomer Pin
yuneiv29-Oct-07 0:22
yuneiv29-Oct-07 0:22 
GeneralRe: I'm a newcomer Pin
David Crow1-Nov-07 10:00
David Crow1-Nov-07 10:00 
Questionhelp me with this Pin
sushmalodhi27-Oct-07 8:22
sushmalodhi27-Oct-07 8:22 
AnswerRe: help me with this Pin
Paul Conrad27-Oct-07 12:07
professionalPaul Conrad27-Oct-07 12:07 
GeneralRe: help me with this Pin
MikeMarq27-Oct-07 18:30
MikeMarq27-Oct-07 18:30 
GeneralRe: help me with this Pin
Scott Dorman28-Oct-07 3:30
professionalScott Dorman28-Oct-07 3:30 
AnswerRe: help me with this Pin
Scott Dorman28-Oct-07 3:32
professionalScott Dorman28-Oct-07 3:32 
GeneralRe: help me with this Pin
sushmalodhi28-Oct-07 9:26
sushmalodhi28-Oct-07 9:26 
QuestionPhD. who are good at the cryptography [modified] Pin
Cryptogrpahy26-Oct-07 19:20
Cryptogrpahy26-Oct-07 19:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.