
A Direction2d represents a direction like 'up' or 'north' or 'forwards'. They
are represented using X and Y components, and can be converted to vectors if
necessary, but should be thought of as conceptually different. Directions have
several uses, such as:
- Constructing a vector from a length and direction
- Determining the component of a vector in a particular direction (for
example, finding the component of velocity in the up direction to get
vertical speed)
- Determining the (signed) angle between two directions
- Defining the orientation of an axis or reference frame