Shortest Great Circle Distance....

e2dot718

New member
Joined
Jul 20, 2006
Messages
7
I'm havnig trouble trying to figure out how on the surface of a sphere (earth) to calculate the shortest distance from a point (person) to a geodesic segment (a street). The coordinate system is lat/lon. In 2d space this is easy. You'd just find the orthoganol that bisects the triangle into 2 right triangles and compute the length of the shared side. How can I adapt this logic to the surface of a sphere? Ideally, I would not use matricies to solve the problem. Is that possible?


Best Regards,

Erik
 
Three points define a unique plane. Use the center of the Earth as point #3, then you have a pie rather than a right triangle. It's not very different. You just have to let go of thinking you have the plane before you start. Use the plane you need.
 
I hope I understand you correctly.

If you let r=radius of Earth, then each point on the Earth has spherical coordinates \(\displaystyle (r,{\theta},{\phi})\)

Let's say we have a point A at 60 deg West longitude and 40 deg North latitude and point B at 40 deg West longitude and 20 degrees North latitude. What is the shortest distance between the points?.

Point A: \(\displaystyle {\theta}=360-60=300; \;\ {\phi}=90-40=50\)

Point B: \(\displaystyle {\theta}=360-40=320; \;\ {\phi}=90-20=70\)

If you take unit vectors directed from the origin to A and B, you have:

\(\displaystyle U_{A}=sin(50)cos(300)i+sin(50)sin(300)j+cos(50)k\)

\(\displaystyle U_{B}=sin(70)cos(320)i+sin(70)sin(320)j+cos(70)k\)

The angle between A and B is \(\displaystyle cos^{-1}(U_{A}\cdot{U_{B}})=0.459486\)

If you let the Earth's radius be, say, 4000 miles, you have:

\(\displaystyle 4000(0.459486)\approx{1838}\;\ miles\)


I hope this helps. Is it what you wanted?. Maybe close.
 
tkhunny said:
Three points define a unique plane. Use the center of the Earth as point #3, then you have a pie rather than a right triangle. It's not very different. You just have to let go of thinking you have the plane before you start. Use the plane you need.

Hrm, not quite sure why this would be point #3. The way I see it, is I have already 3 points. I have the person's current position, #1. I have a street (geodesic segment) that is defined by points #2 and #3. If you draw a line on the surface of the sphere between all these points (assuming #1 is not on the geodesic segment connectivg #2 and #3), you have something that resembles a triangle, but where each edge is curved along the surface (what would you call this?).

The challenge is, now to find the shortest distance from #1 to any point between #2, #3 (inclusive of the end points).

Basically, what is my distance from a street that I am facing? The facts are that I know my GPS position and the GPS start and end positions of street on the block. I might be nearest to the end points of the street or I might be nearest to any other point on the street.
 
galactus said:
I hope I understand you correctly.

If you let r=radius of Earth, then each point on the Earth has spherical coordinates \(\displaystyle (r,{\theta},{\phi})\)

Let's say we have a point A at 60 deg West longitude and 40 deg North latitude and point B at 40 deg West longitude and 20 degrees North latitude. What is the shortest distance between the points?.

I hope this helps. Is it what you wanted?. Maybe close.

Almost, but the problem is that this would only help me figure out the distance from where I am to the start of the street segment or to the end of the street segment. I want to find the minimum distance between me and the street segment, which could be anywhere between the starting lat/lon of the street segment and the ending lat/lon of the street segment.

Does that make sense?


Take care,

Erik
 
Thanks all for your help. I decided that using plain old Mercator Projection to get the numbers into a Cartesian plain and calculate the shortest distance from there will be accurate enough for my application. I think I was operating more on principle than on common sense. Distances are rarely more than a couple city blocks. (should have mentioned that before!)
 
If you're just wanting to know the distance from a point to a line, why use spherical trig(unless it's mighty long)?. Just use plane trigonometry, as in surveying.

If you know the direction of the line and want to know the shortest distance to it from a point, you can use a resection. The shortest distance would be a perpendicular bisector of the line.
 
galactus said:
If you're just wanting to know the distance from a point to a line, why use spherical trig(unless it's mighty long)?. Just use plane trigonometry, as in surveying.

Right, exactly. That's what I've decided to do. Tests so far seem to be right on...



Thanks,

Erik
 
Top