Re: Latitude / longitude distance and bearing.



Dave (from the UK) wrote:
David Bernier wrote:
Dave (from the UK) wrote:

I have two locations, call them 'a' and 'b' .

a) Altitude of a and b (call them alt_a and alt_b).
b) Latitude of b and b (call them lat_a and lat_b)
c) Longitude of a and b (call them long_a and long_b)


'a' and 'b' are fairly close together (10 - 20 km) and in line of sight distance. (Two mountain peaks).

I want to find

1) The straight line distances from a to b. (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula)


2) The bearing of 'a' when viewed from 'b'.



The Web page you refer to below mentions two kinds of
bearings:

(1) The initial bearing (at 'b') for an arc of a great-circle from 'b'
to 'a'.

(2) The "rhumb line" bearing, where a rhumb line or loxodrome is a path
of constant bearing . The rhumb line route in general is longer than
the arc of great circle route.

Of the two, I think #1 is easier to compute than the "rhumb line" bearing.



But the distance I want is I believe shorter than even the arc of the great circle, as that is (I believe) the distance you would travel if you drove a car from a to b, rather than tunnel through the earth which would give a shorter distance.

I believe the distance

r = sqrt(dx*dz + dy*dy + dz*dz)

is the correct distance - i.e. the distance the crow would fly.


Yes, I understand. Above, I was assuming altitudes of 0 for a and b, and the choice
of an arc of great circle route *or* a "loxodrome" route, both on the surface of
the globe, to simplify the explanation of bearings of type #1 and #2.
I think the "rhumb line" bearing (type #2) was of interest to navigators at
sea from, say, 1400-1900 (+/- whatever). I think you're probably more
interested in the type #1 bearing.

3) The vertical angle - i.e how many degress above the horizon is 'a' when viewed from 'b'. (alt_a > alt_b).



So I guess for the horizon you mean the plane perpendicular
to a plumb line ...

If I interpret what you say correctly, then you mean 90 deg away from vertical, i.e. horizontal. That is indeen what I mean by horizon.

Fine. The vertical in physics is often taken as the plumb line direction.

If the altitude values are included, and the
bearing of 'a' when viewed from 'b' is measured as the crow flies or would
fly, I believe the altitudes don't matter and
the initial bearing for an arc of a great-circle from b0 to a0 can be used,
where a0 (resp. b0) has the same latitude/longitude as a (resp. b) but
altitude 0...



For the the elevation, consider the points a, b and O, the center of the
earth. The lengths of the three sides of triangle abO can be computed.

Yes, I think I can do that. I know the xyz coordinates of all points.

Then I think the elevation, from my assumption about the horizon,
would be the measure of the angle of the triangle at 'b' minus 90 degrees.

That is interesting. I'll look into that and calculate that.

I have done this for a couple of places a and b and get an elevation angle of about 30 degrees. Someone else gets about 80 degrees - clearly a huge difference. I don't know what method he is using.

I've done it like this.

1) Calculated the radial distance r from

r = sqrt(dx*dz + dy*dy + dz*dz)

(we agress on that one.)

Yes, in other words, r is the length of the side ab of the triangle.

2) Assumed a right-angled with a hypotenuse of the length r, which is known from above.


In the general case, none of the angles of the triangle abO will be
exactly 90 degrees. But the lengths of the three sides are
already known.

Any of the three angles can be computed from the law of
cosines. The law of cosines is explained here:
http://en.wikibooks.org/wiki/Trigonometry:Law_of_Cosines

and there is a page on "solving triangles" (three known
sides being one solvable case) here:
http://en.wikibooks.org/wiki/Trigonometry:Solving_Triangles

David Bernier
.



Relevant Pages

  • Re: Latitude / longitude distance and bearing.
    ... Altitude of a and b. ... (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula) ... The bearing of 'a' when viewed from 'b'. ... The lengths of the three sides of triangle abO can be computed. ...
    (sci.math)
  • Re: Latitude / longitude distance and bearing.
    ... Altitude of a and b. ... (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula) ... The bearing of 'a' when viewed from 'b'. ... The lengths of the three sides of triangle abO can be computed. ...
    (sci.math)
  • Re: Latitude / longitude distance and bearing.
    ... (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula) ... The bearing of 'a' when viewed from 'b'. ... altitude could be below the horizon when viewed from the one with lower altitude, but in this case, the distances are small. ...
    (sci.math)
  • Re: Posting in order to be considered academically brilliant!
    ... To calculate distance and bearing between two Latitude/Longitude ... The JavaScript implementation is shown below. ... if E:W line q = cos(length of a circle of latitude) ...
    (misc.fitness.weights)
  • Posting in order to be considered academically brilliant!
    ... To calculate distance and bearing between two Latitude/Longitude ... The JavaScript implementation is shown below. ... travelled and R is the earth?s radius ...
    (misc.fitness.weights)