The scalar range of 0..1 works for most cases, but sometimes the bipolar scale of -1..1 makes more sense. In this range, 0 represents neutral. It’s still a percentage scaling, but now -100% to 100%, instead of than 0 to 100%.
An example use case is panning of audio in the stereo field:
Bipolar values are used by jitter to have values go above and below a given value.
As with scalars, there are few things we’d like to be able to do with them - especially to help us avoid being out-of-range. The basics are:
A common need is to nudge a bipolar value toward its neutral value of zero. Sort of like bringing something into balance. We don’t care if it’s above or below zero, we just want to draw it to zero. towardZero helps.
Immutable
If you’re working with bipolar values a lot, there’s also immutable . It returns an immutable wrapper around a value, hanging the same functions off it and making sure it’s always within bipolar range.