AngleRange class

Represents angle ranges as a circular sector by using an absolute start angle and a relative range angle called extent.

They both define a sector on a circle. All angles are in degrees and are clockwise-oriented. By default, the AngleRange represents the entire circle, the value is in the range of [0, 360]. Values will be corrected during construction using normalization for the start angle and clamping for the extent angle, ensuring a valid range for all possible inputs.

Annotations

Constructors

AngleRange(double start, double extent)
Constructs an AngleRange from the provided start and extent angles.
factory
AngleRange.fullCircle()
Constructs a range covering a full circle.
factory

Properties

extent → double
The angle range extent, running clockwise, in degrees from start. The value is in the range of [0, 360] degrees.
final
hashCode → int
The hash code for this object.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
start → double
Start angle, running clockwise, in degrees from north. The value is in the range of [0, 360) degrees.
final

Methods

closestInRange(double angleClockwiseInDegreesFromNorth) → double
Get the angle that is closest to the given one and in range.
inRange(double angleClockwiseInDegreesFromNorth) → bool
Check if a given angle in degrees, clockwise from north is in range or not.
max() → double
Get the maximum angle defined by the range in degrees, clockwise from north, normalized to [0,360).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.

Static Methods

fromDirectionDegreesClockwise(double center, double extent) AngleRange
Constructs an AngleRange from the provided center angle defining the direction and an angular width to extent the range by 50% clockwise and 50% counter-clockwise from its center angle.
fromMinMaxDegreesClockwise(double min, double max) AngleRange
Constructs an AngleRange from the provided minimum and maximum angles.