Angle class

Canonical mathematical concept of an "angle".

The opening between two rays. An Angle exists within the range (-360°, 360°). A new Angle produced from an existing Angle by adding, subtracting, dividing, multiplying, etc. will be limited to the the aforementioned range. To represent angles beyond 360°, see Rotation.

Available Extensions

Constructors

Angle.fromDegrees(num degrees)
Constructs a new Angle from the given degrees.
const
Angle.fromPercent(double percent)
Constructs a new Angle from the given percent.
const
Angle.fromRadians(num radians)
Constructs a new Angle from the given radians.
const

Properties

category AngleCategory
This Angles category, e.g., acute, obtuse, or reflexive.
no setter
complement Angle
Converts a non-reflexive Angle to its reflexive complement, or a reflexive Angle to its non-reflexive complement, e.g., 90° -> 270° or 270° -> 90°.
no setter
degrees num
Angle expressed as degrees.
final
hashCode int
The hash code for this object.
no setteroverride
isAcute bool
True if this Angle is acute, i.e., in [0°, 90°).
no setter
isNegative bool
True if this Angle is less than zero.
no setter
isObtuse bool
True if this Angle is obtuse, i.e., in [90°, 180°).
no setter
isPositive bool
True if this Angle is greater than or equal to zero.
no setter
isReflexive bool
True if this Angle is reflexive, i.e., in [180°, 360°).
no setter
percent num
Angle expressed as a percentage.
final
radians num
Angle expressed as radians.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

isApproximately(Angle other, {num percentVariance = 0.01}) bool
isEquivalentTo(Angle other) bool
makeNegative() Angle
Returns a negative version of this Angle.
makePositive() Angle
Returns a positive version of this Angle.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rotate(Angle other) Rotation
Adds the other Angle to this Angle, producing a Rotation.
toString() String
A string representation of this object.
override

Operators

operator *(num scalar) Angle
Multiplies this Angle by the given scalar.
operator +(Angle other) Angle
Adds two Angles together, producing a new Angle.
operator -(Angle other) Angle
Subtracts the other Angle from this Angle, producing a new Angle.
operator /(num scalar) Angle
Divides this Angle by the given scalar.
operator ==(Object other) bool
The equality operator.
override
operator unary-() Angle
Returns a new Angle, which is the same as this Angle but in the opposite direction.

Static Methods

lerp(Angle a1, Angle a2, double t) Angle
Linearly interpolates between a1 and a2 at time/percent t.

Constants

deg30 → const Angle
deg45 → const Angle
deg60 → const Angle
deg90 → const Angle
deg180 → const Angle
zero → const Angle