7

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?

3
  • 1
    It took me a while and some research to figure out what was going on, so I thought I'll post a question-answer here, maybe it'll help someone :) Apr 22, 2017 at 1:14
  • 1
    Nice one, I remember the number 1.852 from mapping software I learnt from as a student. Realizing what it was was very educational and provides a mental shortcut that I use still.
    – mdsumner
    Apr 22, 2017 at 5:40
  • Cool! Had to look that one up too, but it's great to see all these numbers making sense: 1.852 -> en.wikipedia.org/wiki/Nautical_mile Apr 22, 2017 at 15:26

1 Answer 1

16

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:

  • 1 rad = 180°/π
  • 1° = π rad/180

Here's a great visualization that explains this relation well:

enter image description here

(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
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.