Holds an angle value.
Angle values are constructed by global rad(float)
or deg(integer)
functions.
Angle literals are numeric values with unit designators. All these expressions evaluate to true:
360deg instanceof Angle;
360deg == Math.PI * 2 * 1rad;
360deg == 400grad;
360deg == 1turn;
1turn / 2 == 180deg;
TIScript supports all angle units defined by CSS:
deg
- degree, there are 360 degrees in full circle;rad
- radians, 2*π radians in full circle;grad
- gradians, 400 gradians in full circle;turn
- turns, 1 turn is exactly 360 degree - one full circle(s: string) : angle
Static method (of the class), parses the string using CSS rules.
() : float
Returns number of radians.
() : integer
Returns number of degrees.
() : string
Returns "NNNrad" string where NNN is a number of radians.
( from : angle, to:angle, ratio: float ) : angle
Computes the average angle using the formula: (to - from) * ratio + from
.