ArcGIS Desktop Help on How Aspect works explains the calculations used, but introduces the for me magic number of 57.29578:
aspect = 57.29578 * atan2 ([dz/dy], -[dz/dx])
Where does this number come from and what does it stand for?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityArcGIS Desktop Help on How Aspect works explains the calculations used, but introduces the for me magic number of 57.29578:
aspect = 57.29578 * atan2 ([dz/dy], -[dz/dx])
Where does this number come from and what does it stand for?
In a GIS aspect is generally shown in radians.
57.29578
is 1 radian in degrees - ArcGIS is using this number when converting to radians.
A simple way to remember how to convert from degrees to radians and vice versa, is to keep in mind that 180° = π rad (check out the corresponding section on Khan Academy) - therefore:
Here's a great visualization that explains this relation well:
(Credit - Lucas V. Barbosa - Own work, Public Domain)
And here's some python code for converting one way and the other:
import math
def radians_to_degrees(radians):
"""converts radians to degrees."""
# pi radians = 180 degrees -> 1 radians = 180/pi degrees
rads_in_degrees = ( 180 / math.pi ) * radians
return rads_in_degrees
def degrees_to_radians(degrees):
"""converts degrees to radians."""
# pi radians = 180 degrees -> 1 degree = pi/180 radians
degs_in_rads = ( math.pi / 180 ) * degrees
return degs_in_rads
Running the code let's us finally (with a drumroll...) reveal the mystery number's identity unambiguously:
print(radians_to_degrees(1))
print(degrees_to_radians(57.29578))
>>>> 57.29577951308232
>>>> 1.0000000084983167