CartesianRotation extension

Extensions for Rotation objects that introduce Cartesian concepts.

Clockwise and Counter-Clockwise: You might wonder why CW and CCW properties are defined here, rather than on Rotation, itself. Consider that when you look at a device screen, positive rotations move clockwise. When you look at a mathematical graph, positive rotations move counter-clockwise. A rotation in isolation cannot know whether it is CW or CCW. Thus, this directional concept is tied to a particular Cartesian orientation.

on

Methods

direction([CartesianOrientation orientation = CartesianOrientation.screen]) AngleDirection
Returns AngleDirection.clockwise if this Rotation is clockwise within the given orientation, or AngleDirection.counterClockwise otherwise.
isClockwise([CartesianOrientation orientation = CartesianOrientation.screen]) bool
True if this Rotation represents a clockwise turn, or zero.
isCounterClockwise([CartesianOrientation orientation = CartesianOrientation.screen]) bool
True if this Rotation represents a counter-clockwise turn, or zero.
makeClockwise([CartesianOrientation orientation = CartesianOrientation.screen]) Rotation
Returns a clockwise version of this Rotation.
makeCounterClockwise([CartesianOrientation orientation = CartesianOrientation.screen]) Rotation
Returns a counter-clockwise version of this Rotation.