Convenience functions for working with scalar (floating-point) values.
Interpolate from the first value to the second, based on a parameter that ranges from zero to one. Passing a parameter value of zero will return the start value and passing a parameter value of one will return the end value.
Scalar.interpolateFrom 5 10 0.5
--> 7.5
Scalar.interpolateFrom 2 -2 0.75
--> -1Parameter values less than zero or greater than one can be used to extrapolate:
Scalar.interpolateFrom 5 10 1.5
--> 12.5
Scalar.interpolateFrom 2 -2 -0.25
--> 3Construct an interval containing both of the given values (which can be given in either order).
Scalar.hull 2 3
--> Interval.with { minValue = 2, maxValue = 3 }
Scalar.hull 5 -1
--> Interval.with { minValue = -1, maxValue = 5 }Construct an interval containing all values in the given list. If the list
is empty, returns Nothing.
Scalar.hullOf [ 2, 1, 3 ]
--> Just (Interval.with { minValue = 1, maxValue = 3 })
Scalar.hullOf [ -3 ]
--> Just (Interval.singleton -3)
Scalar.hullOf []
--> Nothing
Check if two values are equal within a given tolerance.