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
Result is in radians: 0.737815 / PI *180 = 42
Solution is to divide the atan output answer by PI, and multiply by 180.
Thanks a lot, my maths are quite old...
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
>>>
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.
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?
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.