📖 Read the detailed guide for hand-written examples and background.
public tuple angle(real radians)
an angle is just a wrapper around a real which allows for typesafe APIs without the confusion between radians and degrees
public function angle.degrees() returns real
get the real representation of this angle in degrees
public function angle.radians() returns real
get the real representation of this angle in radians
public function real.asAngleDegrees() returns angle
interpret this real as an angle given in degrees
public function real.fromDeg() returns angle
interpret this real as an angle given in degrees
public function real.fromRad() returns angle
interpret this real as an angle given in degrees
public function int.fromRad() returns angle
interpret this int as an angle given in degrees
public function int.asAngleRadians() returns angle
interpret this int as an angle given in radians
public function real.asAngleRadians() returns angle
interpret this real as an angle given in radians
public function angle.sin() returns real
get the sine of this angle
public function angle.cos() returns real
get the cosine of this angle
public function angle.tan() returns real
get the tangent of this angle
public function angle.op_plus(angle other) returns angle
adds two angles
public function angle.op_minus(angle other) returns angle
substracts two angles
public function angle.op_mult(real scalar) returns angle
multiplies the angle with the given scalar
public function real.op_mult(angle ang) returns angle
multiplies with the given angle
public function angle.op_divReal(real scalar) returns angle
divides the angle by the given scalar
public constant DEGTORAD = 0.017453293
Converts Degrees to Radians
public constant RADTODEG = 57.295779513
Converts Radians to Degrees