Angle

Angle

Source on GitHub

📖 Read the detailed guide for hand-written examples and background.

Tuples

angle

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

Extension Functions

angle.degrees

public function angle.degrees() returns real

get the real representation of this angle in degrees

angle.radians

public function angle.radians() returns real

get the real representation of this angle in radians

real.asAngleDegrees

public function real.asAngleDegrees() returns angle

interpret this real as an angle given in degrees

real.fromDeg

public function real.fromDeg() returns angle

interpret this real as an angle given in degrees

real.fromRad

public function real.fromRad() returns angle

interpret this real as an angle given in degrees

int.fromRad

public function int.fromRad() returns angle

interpret this int as an angle given in degrees

int.asAngleRadians

public function int.asAngleRadians() returns angle

interpret this int as an angle given in radians

real.asAngleRadians

public function real.asAngleRadians() returns angle

interpret this real as an angle given in radians

angle.sin

public function angle.sin() returns real

get the sine of this angle

angle.cos

public function angle.cos() returns real

get the cosine of this angle

angle.tan

public function angle.tan() returns real

get the tangent of this angle

angle.op_plus

public function angle.op_plus(angle other) returns angle

adds two angles

angle.op_minus

public function angle.op_minus(angle other) returns angle

substracts two angles

angle.op_mult

public function angle.op_mult(real scalar) returns angle

multiplies the angle with the given scalar

real.op_mult

public function real.op_mult(angle ang) returns angle

multiplies with the given angle

angle.op_divReal

public function angle.op_divReal(real scalar) returns angle

divides the angle by the given scalar

Constants

DEGTORAD

public constant DEGTORAD = 0.017453293

Converts Degrees to Radians

RADTODEG

public constant RADTODEG = 57.295779513

Converts Radians to Degrees