PolarCoord class

Canonical mathematical concept of a "polar coordinate".

Polar coordinates are defined by an angle, and a distance from the origin, e.g., (100, 45°). The distance is often referred to as the radius.

Polar coordinates offer an alternative expression to positions other than Cartesian coordinates. Polar coordinates naturally lend themselves to radial problem spaces, e.g., clock and watch faces, radial progress indicators, radial thermostat and thermometer displays, etc.

Polar coordinates may be added together, subtracted from each other, multiplied and divided by scalars, and rotated by an angle. It is also possible to calculate the angle between polar coordinates.

Available Extensions

Constructors

PolarCoord(double radius, Angle angle)
const

Properties

angle Angle
final
hashCode int
The hash code for this object.
no setteroverride
radius double
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

angleBetween(PolarCoord other, {bool? chooseReflexAngle}) Angle
Returns the Angle between this PolarCoord and other.
isApproximately(PolarCoord other, {num percentVariance = 0.01}) bool
isEquivalentTo(PolarCoord other) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rotate(Angle angle) PolarCoord
Returns a PolarCoord equivalent to this PolarCoord rotated by the given Angle.
toString() String
A string representation of this object.
override

Operators

operator *(num scalar) PolarCoord
Multiplies the radius and angle of this PolarCoord by the given scalar.
operator +(PolarCoord other) PolarCoord
Adds other to this PolarCoord.
operator -(PolarCoord other) PolarCoord
Subtracts other from this PolarCoord.
operator /(num scalar) PolarCoord
Divides the radius and angle of this PolarCoord by the given scalar.
operator ==(Object other) bool
The equality operator.
override
operator unary-() → dynamic
Inverts the direction of this PolarCoord, i.e., rotates it by 180°.