Angle class

Represents an angle. Internally the angle is stored in radians.

Implemented types

Constructors

Angle.a0()
Constructs an angle with 0 degrees
factory
Angle.a180()
Constructs an angle with 180 degrees
factory
Angle.a270()
Constructs an angle with 270 degrees
factory
Angle.a360()
Constructs an angle with 360 degrees
factory
Angle.a90()
Constructs an angle with 90 degrees
factory
Angle.atan2(num a, num b)
Angle.degrees(double degrees)
Constructs an angle from degrees
Angle.full()
Constructs an angle with 360 degrees
factory
Angle.gradians(double gradians)
Constructs an angle from gradians
Angle.half()
Constructs an angle with 180 degrees
factory
Angle.radians(double radians)
Constructs an angle from radians
Angle.turns(double turns)
Constructs an angle from turns
Angle.zero()
Constructs an angle with 0 degrees
factory

Properties

complementary Angle
Returns the complementary angle of this
no setter
degrees double
no setter
gradians double
no setter
hashCode int
The hash code for this object.
no setteroverride
isNegative bool
no setter
isPositive bool
no setter
isZero bool
no setter
normalized Angle
Returns the normalized angle: 45° -> 45° 370° -> 10° -90° -> 270°
no setter
radians double
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supplementary Angle
Returns the supplementary angle of this
no setter
turns double
no setter

Methods

abs() Angle
compareTo(Angle other) int
Compares this object to another object.
override
cos() double
getClosest(List<Angle> angles) Angle
Gets the closest angle out of angles to this. angles must contain at least one angle IMPORTANT: All angles are normalized!
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ratio(Angle other) double
sin() double
tan() double
toString() String
A string representation of this object.
override

Operators

operator *(dynamic factor) Angle
operator +(Angle other) Angle
operator -(Angle other) Angle
operator /(num divisor) Angle
operator <(Angle other) bool
operator <=(Angle other) bool
operator ==(Object other) bool
The equality operator.
override
operator >(Angle other) bool
operator >=(Angle other) bool
operator unary-() Angle

Static Methods

degreesToGradians(double degrees) double
degreesToRadians(double degrees) double
degreesToTurns(double degrees) double
getMinimalDistance(Angle a, Angle b) Angle
Returns the distance between a and b. The returned angle can never be over 180 degrees.
gradiansToDegrees(double gradians) double
gradiansToRadians(double gradians) double
gradiansToTurns(double gradians) double
radiansToDegrees(double radians) double
radiansToGradians(double radians) double
radiansToTurns(double radians) double
turnsToDegrees(double turns) double
turnsToGradians(double turns) double
turnsToRadians(double turns) double