CartesianOrientation class abstract
Frame of reference for mapping Angle
s and PolarCoord
s to Cartesian
coordinates.
CartesianOrientation
s exist because the 0° axis and the positive direction
of an Angle
changes depending on use-case.
In mathematics a 0° angle points to the right, and a positive angle rotates counter-clockwise.
In screen space a 0° angle points to the right, and a positive angle rotates clockwise.
In ship navigation a 0° angle points up, and a positive angle rotates clockwise.
In each of the above use-cases, the exact same Angle
or PolarCoord
corresponds to different Cartesian coordinates due to the orientation.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cartesianToPolar(
Point< num> cartesianCoord) → PolarCoord -
Maps the given
cartesianCoord
within this orientation to aPolarCoord
. -
fromScreenPoint(
Point< num> point) → Point<num> -
Returns the given screen-based
point
as seen by this coordinate system. -
isAngleClockwise(
Angle angle) → bool -
Returns true if the given
angle
represents a clockwise movement from the 0° axis, or false otherwise. -
isAngleCounterClockwise(
Angle angle) → bool -
Returns true if the given
angle
represents a counter-clockwise movement from the 0° axis, or false otherwise. -
isRotationClockwise(
Rotation rotation) → bool -
Returns true if the given
rotation
represents a clockwise movement from the 0° axis, or false otherwise. -
isRotationCounterClockwise(
Rotation rotation) → bool -
Returns true if the given
rotation
represents a counter-clockwise movement from the 0° axis, or false otherwise. -
makeAngleClockwise(
Angle angle) → Angle -
Returns a clockwise version of the given
angle
, as seen through the givenorientation
. -
makeAngleCounterClockwise(
Angle angle) → Angle -
Returns a counter-clockwise version of the given
angle
, as seen through the givenorientation
. -
makeRotationClockwise(
Rotation rotation) → Rotation -
Returns a clockwise version of the given
rotation
, as seen through the givenorientation
. -
makeRotationCounterClockwise(
Rotation rotation) → Rotation -
Returns a counter-clockwise version of the given
rotation
, as seen through the givenorientation
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
polarToCartesian(
PolarCoord polarCoord) → Point< num> -
Maps the given
polarCoord
to Cartesian coordinates within this orientation. -
toScreenAngle(
Angle angle) → Angle -
Returns the given
angle
as seen by a screen's coordinate system. -
toScreenPoint(
Point< num> point) → Point<num> -
Returns the given
point
as seen by a screen's coordinate system. -
toScreenRotation(
Rotation rotation) → Rotation -
Returns the given
rotation
as seen by a screen's coordinate system. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- math → const CartesianOrientation
- screen → const CartesianOrientation