Angle
s are a bit special, they differ from Distance
s and Current
s in that
Angle
s might need to exist within a specific, wrapping domain. If you’ve
studied the unit circle for trigonometry, you might be familiar with this idea.
If not, don’t worry too much, the idea isn’t that complicated.
Lets say we start measuring at 0 degrees (makes sense.). Basically, as a circle wraps around past a full rotation (360 degrees), and we reach 361 degrees, this is equivalent to going back to 1 degree!
Dairy has three ways of configuring this, referred to as Wrapping
modes:
Linear
: no domain bounds, no wrappingWrapping
: domain bounds of [0, 360)
degreesRelative
: domain bounds of [-180, 180)
degreesWrapping
and Relative
are functionally equivalent, but sometimes it might be
nicer to use Relative
rather than Wrapping
.
Relative
always represents the closest value to 0
. While Wrapping
always
represents the same value as a positive number.
Angles have some special extra behaviours, due to Wrapping
:
Angle
with Wrapping
of Linear
if either side of the operation has Wrapping
of Linear
. This is
because otherwise the operation would lose information.Wrapping
s like AngleUnit
s.findError
.Converting between Wrapping
s:
Finding the error:
Angle
s are a bit special, they differ from Distance
s and Current
s in that
Angle
s might need to exist within a specific, wrapping domain. If you’ve
studied the unit circle for trigonometry, you might be familiar with this idea.
If not, don’t worry too much, the idea isn’t that complicated.
Lets say we start measuring at 0 degrees (makes sense.). Basically, as a circle wraps around past a full rotation (360 degrees), and we reach 361 degrees, this is equivalent to going back to 1 degree!
Dairy has three ways of configuring this, referred to as Wrapping
modes:
Linear
: no domain bounds, no wrappingWrapping
: domain bounds of [0, 360)
degreesRelative
: domain bounds of [-180, 180)
degreesWrapping
and Relative
are functionally equivalent, but sometimes it might be
nicer to use Relative
rather than Wrapping
.
Relative
always represents the closest value to 0
. While Wrapping
always
represents the same value as a positive number.
Angles have some special extra behaviours, due to Wrapping
:
Angle
with Wrapping
of Linear
if either side of the operation has Wrapping
of Linear
. This is
because otherwise the operation would lose information.Wrapping
s like AngleUnit
s.findError
.Converting between Wrapping
s:
Finding the error: