5 odpowiedzi
+ 3
One way is to use decorators to make "modifications" of original functions. You can create your own module to reuse it. There are about 10 trigonometric functions in 'math', so it won't be a problem.
+ 2
It's better to just get used it, it's that way in pretty much any programming language!
It's super straightforward if you create a constant `pi2 = math.pi * 2`.
Then all you have to do is think in *fractions of a whole circle* instead of steps of 90 degrees or whatever.
A right angle? That's 1/4th of a whole circle, or `1/4 * pi2`.
45 degrees? That's 1/8th of a whole circle, or `1/8 * pi2`.
It's even easier than degrees.
+ 1
portpass That's how I would have done it.
+ 1
Schindlabua Maybe it could be good choise aswell, when I quickly want to do some testings with the trigonometric functions I rather not fumble with radians.
+ 1
math library has 2 methods: radians and degrees, which can be used to convert them to each others.