I wrote a program, two programs actually, one in Mathcad and another in Excel, which calculate the parameters of a Great Circle defined by any two points. The programs also calculate the bearing angle of the second location, as seen by the first location; and they also calculate the distance between the two locations, along the arc of the Great Circle.

I will begin working on the web page for showing the calculations of the Bearing Angle. I have the Mathcad file ready but converting the Mathcad work to web page html does take quite a bit of time just to do all the
formatting. Every single equation is an image file needing coding and placing on the page. It may be a week – Oct 18 or so – before I get that webpage html-ready and uploaded.

I’ve done some thinking and calculating about both the bearing angle and the distances given in QRZ’s “detail” page for Ham operators. I worked out ways to get both the distance and bearing angle using vector methods and will outline my methods below. If you want more details or have questions, please contact me by writing a comment or emailing me at tango_gal@w7buf.com

I saw a way to get the distance as soon as I started thinking about Great Circles connecting two locations. The bearing angle, though, took me a lot longer to figure out how to calculate. It shouldn’t have, really, because I had all the pieces and all the math I needed right in front of me. I finally got it today, after just sitting with it and thinking through what needed to be done. There are lots of webpages where these kinds of calculations can be done for you, but I enjoy working out things like this on my own, if I can. I’m pretty good with vector mathematics so I enjoyed this challenge. I know that for some people, math is like death itself.

Here is an overview of the methods I used for my calculations. I wrote out the position vectors from the Earth’s center pointing to the two locations. First these were in polar spherical coordinates. I defined things as follows: the XY plane is the Earth’s Equatorial plane. The X axis is the GMT meridian. The angle theta is equal to the longitude of the location of interest because longitude is measured from the GMT meridian. East Longitudes are positive angles and West longitudes are negative angles. In Polar Spherical coordinates, the three coordinates are R = Radius of Earth in this case; Theta as described; and another angle (PHI) is measured from the Z axis, which coincides with the North end of the Earth’s axis of rotation. Since latitudes are measured from the Equator, PHI = 90 – Latitude. ((North latitudes are positive, giving values of PHI between 0 and 90. South latitudes are negative, so 90 – latitude gives a result greater than 90.

Next I converted the polar spherical cooordinates of the two locations, into x,y,z rectangular coordinates so I could take their dot product and use that to get the angle between those two position vectors. The dot product of two vectors gives the cosine of the angle between them and mulitplied by the magnitudes of the two vectors. Our vectors magnitude are each = the radius of the Earh. So divide the dot product by R squared and take the arc-cosine of the result. That will give the angle between the two position vectors. Multiplying that angle by the Radius of the Earth give me the distance from one point to the other along a Great Circle arc. Care must be taken during all of these steps that the trig functions are all calculated using the same angle mode, either all radians (recommended) or else all in degrees. If you use degrees you must convert that final angle between the two position vectors into radians before multipyling it by the Radius of the Earth to get the distance between the locations along the Great Circle arc. That’s the distance QRZ gives in it’s “detail” page when you look up someone’s call sign.

I’m sure there’s a more elegant way to get the bearing angle than what I finally came up with, but that’s okay, I’m probably not actually going to use these equations for anything else. And I set them all up in Mathcad so if I do want to use them all I would have to do is plug in the latitude and longitude of new locations and Mathcad will give me the results.

Using the same vector methods I’ve used for calculating the six elements of elliptical orbits, I calculated both the inclination and the ascending node of the Great Circle. My example points were my home location and that location in Indianna I mentioned before. The ascending node is the longitude at which the Great Circle intersects the equator while entering the Northern hemisphere. (Picture something traveling North-Easterly along the Great Circle). The inclination is the angle the plane of the Great Circle makes with the equator at that intersection point. To calculate the incination angle, we first find a vector perpendicular to the plane of the Great Circle. Let’s call it vector C. Simply take the cross product of the two position vectors. That gives vector C, which is a vector perpendicular to both of the positions and perpendicular to the GC plane. Because of that, the angle this new vector makes with the Z axis is precisely the angle at which the plane of the GC makes is tilted from the Equatorial plane. If the Great Circle was an orbit we would call this angle the inclination of the orbit. To get the inclination angle, take the dot product of the new vector (C) with a unit vector along the Z axis; ie (0,0,1). Since the dot product gives the cosine of the angle between the vectors mulitplied by the magnitudes of the two vectors, we divide this result by the Earth’s radius and take the arc-cosine. This will then be the inclination angle. Pay attention to the angle mode of the calculator you are using. You need to know whether your angle is coming out in radians or in degrees.

To get the location where the Great Circle intersects the Equator, (which for orbits is called the longitude of the ascending node, OMEGA), calculate the cross product of vector C with the unit Z axis vecor. This gives a vector “D” perpendicular to the Z axis and which lies in the plane of the Great Circle (in other words perpendicular to both vectors which were crossed to get it). Vector D is the line of intersection of the plane of the Great Circle and the Equatorial plane. The longitude of the ascending node is measured along the Equator, from the X axis (at the GMT),
to this vector D. It can be calculated by taking either the dot or cross product of Vector D with a unit vector along the X axis ie; (1, 0 , 0) and then dividing by Earth’s radius again, and taking the arc-cosine or arcsine depending on whether dot or cross product was used.

The next part got wild and crazy. All I wanted was a vector tangent to the Great Circle at my home location so I could find it’s direction relative to North. That’s the “initial bearing” which is what QRZ gives on it’s “detail” page. I used my first formula again to calculate the angular sweep from the ascending node to my home location along the Great Circle. Let’s call this angle ALPHA. (Dot product of vector D with my home position vector then divide by R and arc-cosine). Then I wrote a position vector for a point along the circle which is the same angular distance as my home position is from the ascending node. Basically X = R * cosine(ALPHA) and Y = R * sine(ALPHA) and Z = 0.

If you’re not dizzy yet you will be in a moment. At that location I wrote a vector tangent to the Great Circle. (simply add 90 degrees to ALPHA in the previous vector formulas: Xtangent = R * cos(ALPHA + 90); Ytangent = R * sin(ALPHA + 90) and Z = still zero. I’m saying “90” but if you are using radians you must use 1.573 instead of 90.

Now comes the tricky part. WE need to rotate this XY plane around two axes so that it ends up being the plane of the Great Circle. This is done using rotation matrices. The first rotation is around the Z axis, by an amount OMEGA degrees (or radians). That rotation brings the X axis to where the great circle intersects the Equator. The second rotation is around the (new) X axis, by an amount = the inclination of the Great Circle). After these two rotations, the Great Circle has the inclination and ascending node location it is supposed to have. Those rotations transformed that vector which was tangent to the circle into what it’s coordinates look like in the Earth’s Latitude Longitude coordinate system. Since the tangent vector we wrote was located ALPHA degrees along the Great Circle, it should now be located right at my home position. Check to make sure that the tangent vector, after those two coordinate system rotations, is perpendicular to the home location position vector. Take their dot product and it should give zero. To get the bearing angle which all of this was for, I still needed another vector. I needed one which was tangent to the Earth’s surface at my home location but pointing in a Northerly direction (along a line of constant longitude). The key to writing that one was realize that vector would be perpendicular to my home location position vector. If my home position latitude is 30 degrees North, then the tangent vector would be at an angle of 90 + 30 from the Z axis. That enabled me to write it. Call it vector E. The last step was to take the cross product of E with the vector tangent to the Great Circle. Dividing this result by R again, and taking the arcsine gives the bearing angle.

I wish I could provide nice diagrams for all this but I don’t have a way to do that. What I can do is show the particular Great Circle I was working with, from the place where it intersects the equator, to where it passes through my home location and then goes to that location of the ham in Indianna. The Great Circle crosses the Equator pretty near to that bit of land in the very bottom left corner. That bit of land is the NorthEastern “corner” of Papa New Guinea, which has the village of Kavieng on Latangia Island.

Map showing Great Circle from ascending node at the equator to Eugene and on to Indianna

What Visitors Like

Permanent link to this article: https://w7buf.com/2011/07/25/more_on_distances_and_bearing_angles/

While looking at the map I made of Ham operators I have heard, I noticed that some of the bearing angles reported by QRZ don’t seem to be what I would expect. For example, I would think that a location East of me, with a SMALLER/LOWER latitude, would show a bearing angle of MORE than 90 degrees. First I noticed that W7WTR in Idaho Falls, showed a bearing angle of 90.0 degrees in QRZ. Then I noticed his latitude is SMALLER/LOWER than mine at 43.545718, compared to my 44.077080. (His longitude is smaller in a Westerly sense, making him East of me; his -112.051715 to my -123.085120, so no problem there). But why isn’t his bearing angle at least a little bit greater than 90.0? His latitude is about half a degree smaller at a distance of 550 miles. Roughly how many miles is half a degree latitude? A ham 100 miles almost due North of me has latitude 45.505. That means that about 100 miles corresponds roughly with 1.4 degrees of latitude. Idaho Falls is 0.52 degrees smaller latitude, so that would translate to about W7WTR being about 33 miles South while 550 miles East. Using trigonometry, I would expect this to be about 3 degrees deviation South of East. On a flat Earth, there is no way that the bearing angle would be 90.0 degrees, it would be about 93 degrees. That suggests that this seeming anomaly has to do with bearing angles measured along “Great Circle” arcs rather than being angles calculated using flat out plane Geometry and Trigonometry.

A second example showed up with WB9Z in Indianna. His latitude is 40.717782, compared to my 44.077080 . He is both East of me and South of me, yet his bearing angle in QRZ is 85.0 degrees, not greater than 90. When I first started thinking about these apparent anomalies, I thought maybe it was because the bearing angle was being measured from MAGNETIC North, instead of from a North South running line of Longitude. So I checked a few locations almost due North and due South of me and they have bearing angles around 3 or 4 degrees from 0 or 180 and therefore seem to be measured relative to a N-S longitude line. In Portland, Oregon, (100 Miles North of me) a compass points 16 degrees east of True North, so if bearing angles were referenced to magnetic North, the “anomalies” I have been talking about would be on the order of 16 degrees, not just a few degrees.

So then, I guess it comes down to Great Circles. A circle made by locations having equal latitude is not a Great Circle – except at the Equator. A Great Circle lies in a plane which has the center of the Earth as the center of the circle. Taking an extreme example, for a location at my latitude but 180 degrees different longitude, i.e.; probably in Russia someplace, the Great Circle connecting these two points would run right across the North Pole. The bearing angle in that case would be 0.00!!! It just will not do, to argue that since this location is neither North nor South of mine according to latitude, the bearing angle should be 90 or 270 degrees. Using the Great Circle mapping capabilities available at (which is intended for airline flight path estimates), I got a Great Circle map from my location to a place very very near to WB9Z in Indianna. His bearing angle in QRZ was given as 85.0 degrees, less than 90 even though his latitude is South of mine. In this map, you can easily see that the initial “trajectory” of the Great Circle from my location, is less than 90 degrees. I’m assuming that apparent “trajectory” angle is what is being reported as “bearing angle.”MYSTERY SOLVED!!!!!!

Initial "trajectory" from Oregon is less than 90 degrees on this Great Circle to Indianna

Permanent link to this article: https://w7buf.com/2011/07/22/bearing_angle_mystery/

## What do YOU think?