• Resolved Beef Supreme

    (@polymathy)


    Hello,

    I want to calculate the degree of a slope with a given percent value. The mathematic formular for this is atan(degree(%) / 100 %).

    The degree value is just provided as integer, so I can leave out the last part and just use atan(degree).

    My formular in CFF looks like this
    ATAN(fieldname1)

    However it returns wrong values. For 36 degrees for instance, it should return 19.8 but I get 1.54? What am I doing wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @polymathy

    arctan(36 degree) = 0.560982116 rad, look the screenshot:

    But as in javascript the operands of the operations: SIN, COS, TAN, ATAN, … are considered in radian, you should convert first the value to radian:

    
    ATAN(DEGREES(36))
    

    Best regards.

    Thread Starter Beef Supreme

    (@polymathy)

    Thanks, you got me on the right track I think. I forgot about radian and degree. I get the correct result (for 0.36 that is), but it’s in “arc measure” instead of “degree”.

    If I use the DEGREES function like you mentioned, it works.

    But I had to do it like this:
    DEGREES(ATAN(fieldname1/100))

    Plugin Author codepeople

    (@codepeople)

    Hello @polymathy

    Exactly, thank you very much for sharing your solution.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Calculate slope degree from percent’ is closed to new replies.