Converting N/E Coordinates to Azimuth
Converting N/E Coordinates to Azimuth
(OP)
I'm a civil engineer, and was playing around with Excel this afternoon when I had a wild hare to come up with a more clever way to calculate the azimuth of a line than I had been using.
Trig by itself won't do it. Angle=ATAN(DeltaE/DeltaN) is the starting point, but it results in dividing by zero at 0° and 180°. Also, the other results are limited to quadrants in a mirror image fashion, while azimuths are clockwise 0°-360° starting from north. It's doable, but the method gets pretty complicated.
I found the answer by searching the Excel help file for "angle." I have a love/hate relationship with Excel help, but this time it came through.
The solution is to convert DeltaN and DeltaE to a complex number, then use the IMARGUMENT function to convert the complex number to an angle. Here's what I came up with:
Azimuth = MOD(360+DEGREES(IMARGUMENT(COMPLEX(Northing2-Northing1,Easting2-Easting1))),360)
Assuming I typed this correctly, this will give the azimuth in decimal degrees. From here you can use the time functions convert this to DD-MM-SS. I've done this before, but the technique is at the office, I'm at home, and I'm too tired to do it right now.
Anyway, please tell me what you think. I would also be interested in other techniques you have used.
Fred
Trig by itself won't do it. Angle=ATAN(DeltaE/DeltaN) is the starting point, but it results in dividing by zero at 0° and 180°. Also, the other results are limited to quadrants in a mirror image fashion, while azimuths are clockwise 0°-360° starting from north. It's doable, but the method gets pretty complicated.
I found the answer by searching the Excel help file for "angle." I have a love/hate relationship with Excel help, but this time it came through.
The solution is to convert DeltaN and DeltaE to a complex number, then use the IMARGUMENT function to convert the complex number to an angle. Here's what I came up with:
Azimuth = MOD(360+DEGREES(IMARGUMENT(COMPLEX(Northing2-Northing1,Easting2-Easting1))),360)
Assuming I typed this correctly, this will give the azimuth in decimal degrees. From here you can use the time functions convert this to DD-MM-SS. I've done this before, but the technique is at the office, I'm at home, and I'm too tired to do it right now.
Anyway, please tell me what you think. I would also be interested in other techniques you have used.
Fred





RE: Converting N/E Coordinates to Azimuth
TTFN
RE: Converting N/E Coordinates to Azimuth
Well, that's certainly better than what I came up with. Thanks for jumping in. In all the years I have used Excel, I somehow totally missed ATAN2. Now the equation looks like this:
Azimuth = MOD(360+DEGREES(ATAN2((B5-B4),(C5-C4))),360)
Fred
RE: Converting N/E Coordinates to Azimuth
Can you help me?
Thanks
RE: Converting N/E Coordinates to Azimuth
Thanks guys you are always a big help to me.
RE: Converting N/E Coordinates to Azimuth
RE: Converting N/E Coordinates to Azimuth
The equation shown:
Azimuth = MOD(360+DEGREES(ATAN2((B5-B4),(C5-C4))),360)
simply adds 360 to the DEGREES calc, thus ensuring that it's value is positive, then shows that value MOD 360. You are then assured of a positive value >=0 and <360
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
Steam Engine enthusiasts: www.essexsteam.co.uk
RE: Converting N/E Coordinates to Azimuth
RE: Converting N/E Coordinates to Azimuth
It has pretty powerful COGO and matrix operations built-in. On the downside, it does not appear to be compatible with other spreadsheet programs.
RE: Converting N/E Coordinates to Azimuth
RE: Converting N/E Coordinates to Azimuth
TTFN
RE: Converting N/E Coordinates to Azimuth
Thanks again
RE: Converting N/E Coordinates to Azimuth
RE: Converting N/E Coordinates to Azimuth
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
Steam Engine enthusiasts: www.essexsteam.co.uk
RE: Converting N/E Coordinates to Azimuth
Fred
P.S. It's the trig functions that make engineering far more interesting than accounting.
RE: Converting N/E Coordinates to Azimuth
RE: Converting N/E Coordinates to Azimuth
Perhaps you should paste the exact formula as you are using it in your spreadsheet.
TTFN