angle¶
- class guppylang.std.angles.angle[source]¶
Not an angle in the truest sense but a rotation by a number of half-turns (does not wrap or identify with itself modulo any number of complete turns).
The
halfturnsfield stores the number of half-turns, andfloat()converts to radians by multiplying by π. The built-in constantpiequalsangle(1).For example,
angle(1/2)is equivalent topi / 2:angle(1/2) == pi / 2 # True: both represent π/2 radians (90°) angle(1) == pi # True: both represent π radians (180°) angle(2) == angle(0) # False: a full turn is not identified with zero
- __hash__ = None¶