At 11:49 AM 9/23/2002, Karl Stuempfle wrote:
>Does anyone have code that will determine the geographic location at which 2
>rays (lat/lon and direction) will intersect? I could solve this problem
>easily by applying a standard Cartesian algorithm, but it seems that it
>would introduce possibly HUGE errors as you move further away from the
>equator.
The way i do this kind of thing is to map Lat,lon point into 3 dimensional
vector and then do vector trig on it. I can send you some Java code that
does this, through it doesn't solve the problem you're interested in.
Basically, a great circle can be described by the vector that is normal to
it. Say you have 2 such points, a and b. A point, x, on a great circle
satisfies the vector equation a*x = 0 (where * is dot product). So you can
solve these 3 equations:
a*x = 0
b*x = 0
x*x = 1
By substituting each equation into the next you get a quadratic which will
have two solutions.
>If not, can someone more well-versed in the "Great Circle" than I am answer
>this question: Can I use lat/lon values in a Cartesian algorithm if my
>"rays" don't exceed 2 - 5 kilometers in length? How big would the errors be
>on segments of that size?
Don't use lat/lon directly. Pick a central vector and then subtract it
from the vector representation of each point. Then project each point onto
a plane and use that location for your calculations.
>Any help would be appreciated.
>
>Karl...
>
>--
>[To unsubscribe to this list send an email to "majdart@bbn.com"
>with the following text in the BODY of the message "unsubscribe
>openmap-users"]
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Mon Sep 23 13:26:16 2002
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT