fel3
Civil/Environmental
- Jul 9, 2001
- 885
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