We consider two DoubleAt values equal not just if their elements are equal, but also if they represent the same value at different points of decay.
This is the scaled time when the current value will reach 1 (or -1 for negative values)
This is the scaled time when the current value will reach 1 (or -1 for negative values)
This method is a way of collapsing a DoubleAt into a single value (the time in the past or future where its value would be 1, the unit value).
Time when this value will reach the smallest double value bigger than zero, unless we are already at zero in which case we return the current time
Represents a decaying scalar value at a particular point in time.
The value decays according to halfLife. Another way to think about DoubleAt is that it represents a particular decay curve (and in particular, a point along that curve). Two DoubleAt values may be equivalent if they are two points on the same curve.
The
timeToZero
andtimeToUnit
methods can be used to "normalize" DoubleAt values. If two DoubleAt values do not produce the same (approximate) Double values from these methods, they represent different curves.