Was looking at the examples for Direct and Inverse geodetic calculations and I think i have my head wrapped around most of them. I currently am creating a geodesic line from Point A to Point B using a WGS84 datum. Question: is the initial azimuth from Point A to Point B the same as the initial azimuth from Point B to Point A but with a -180 degrees offset? My gut tells me no but I'll do some testing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, the azimuths are different. GeographicLib's Geodesic::Inverse
function calculates alpha1 and alpha2, the forward azimuths at points 1
and 2. For short lines alpha2 is nearly equal to alpha1. This is not
true in general, as you can easily see by considering geodesics close to
one of the poles. On a sphere, alpha2 - alpha1 is the spherical excess
for the quadrilateral made up for the geodesic line segment, two
meridians and the equator, and is proportial to the area of this
quadrilateral.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ahh thank you for the explanation. I had theorized since my lines were small (~25NM) that the azimuths would be close. Actually I think I can use this initial guess to start an iteration to get to my solution. Many thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok so got something working. I have a GeoLine0 which is known. I then need to create another GeoLine1 that intersects with GeoLine0. At the intersection pointA I know only the azimuthA. I also know the coordinates of PointB. So I guess by creating a tempLine from PointB using azimuthB ~ azimuthA - 180. I use 25NM distance for the temp line since that will gurantee that it intersects GeoLine0.
That is my first guess so now I go back and calculate azimuth@guess. if it is within 0.001 degrees to my target of azimuthA then it is close enough. Otherwise I create two new intersection points: one at the original guess+0.002 in length and another at the original guess-0.002 in length. calculate the azimuths at these two new guesses. now I have three guesses. two of those will have different sign sin delta azimuth from the target. So now I use those two as my boundary and create a new guess point in the middle of these two new points. I go on like this until one of my guesses has an azimuth that comes within my tolerance of 0.001 degrees.
Seems to work rather well. On my test cases I get convergence in 8 or less loops. I could probably optimize it but at this point I have it working and will come back to it once the other peices are working.
~AGP
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Was looking at the examples for Direct and Inverse geodetic calculations and I think i have my head wrapped around most of them. I currently am creating a geodesic line from Point A to Point B using a WGS84 datum. Question: is the initial azimuth from Point A to Point B the same as the initial azimuth from Point B to Point A but with a -180 degrees offset? My gut tells me no but I'll do some testing.
No, the azimuths are different. GeographicLib's Geodesic::Inverse
function calculates alpha1 and alpha2, the forward azimuths at points 1
and 2. For short lines alpha2 is nearly equal to alpha1. This is not
true in general, as you can easily see by considering geodesics close to
one of the poles. On a sphere, alpha2 - alpha1 is the spherical excess
for the quadrilateral made up for the geodesic line segment, two
meridians and the equator, and is proportial to the area of this
quadrilateral.
Ahh thank you for the explanation. I had theorized since my lines were small (~25NM) that the azimuths would be close. Actually I think I can use this initial guess to start an iteration to get to my solution. Many thanks.
At the latitude of Helsinki (60d), the change is azimuth of an east-going geodesic over 25 NM is 0.72d
I'll let you judge whether this is small.
That's definitely not small for my purposes. But its a good starting point. I'll post once I have something working.
Ok so got something working. I have a GeoLine0 which is known. I then need to create another GeoLine1 that intersects with GeoLine0. At the intersection pointA I know only the azimuthA. I also know the coordinates of PointB. So I guess by creating a tempLine from PointB using azimuthB ~ azimuthA - 180. I use 25NM distance for the temp line since that will gurantee that it intersects GeoLine0.
That is my first guess so now I go back and calculate azimuth@guess. if it is within 0.001 degrees to my target of azimuthA then it is close enough. Otherwise I create two new intersection points: one at the original guess+0.002 in length and another at the original guess-0.002 in length. calculate the azimuths at these two new guesses. now I have three guesses. two of those will have different sign sin delta azimuth from the target. So now I use those two as my boundary and create a new guess point in the middle of these two new points. I go on like this until one of my guesses has an azimuth that comes within my tolerance of 0.001 degrees.
Seems to work rather well. On my test cases I get convergence in 8 or less loops. I could probably optimize it but at this point I have it working and will come back to it once the other peices are working.
~AGP