Hello!
I want to calculate the slope of the roof of the house and get the result in degrees. I have the height difference between the highest and lowest points of the roof and the length of the roof in the attribute table. Have tried math.atan () but do not get it to work. I have used field calculator.
Tomas
Solved! Go to Solution.
Result is in radians: 0.737815 / PI *180 = 42
Solution is to divide the atan output answer by PI, and multiply by 180.
show the field calculator expression... also, you do have the python parser selected? Did you go to the Results window and check the error message? and if so what was it?
Hi,
Yes I have the python parser, the expression is:
math.atan(2.5/2.75 )
I get a result but it is wrong or not i degree. The result I get is 0,737815 it should be 42.
Result is in radians: 0.737815 / PI *180 = 42
Solution is to divide the atan output answer by PI, and multiply by 180.
Hi,
Thanks a lot!
of course atan doesn't return degrees, it needs to be converted using the math.degree method
>>> import math
>>> math.degrees(math.atan(2.5/2.75))
42.27368900609374
>>>
Thanks a lot, my maths are quite old...