Python math module grad

1.6k Views Asked by At

I am trying to use the basic sin, cos, arctan, etc function from numpy, but I want to use gradians. I have search the doc without success, and search for other python modules without luck. Any suggestion on a python module i could use?

Or a function that will work. I have tried different methods to convert grad to rad and back to grad again, but no-one is working.

1

There are 1 best solutions below

5
On BEST ANSWER

This one should be fine !

def gradFromRad(rad):
    return 200*rad/math.pi
def radFromGrad(grad):
    return math.pi*grad/200