Domain range of ContinuousPiecewiseLinearFunction #63
Labels
djutils-draw
djutils-draw project
djutils-math
djutils-math project
question
Further information is requested
Currently, the ContinuousPieceWiseLinearFunction limits domain values to the interval [0.0, 1.0]. This is well suited for catching errors in the original use of these functions (offset-functions for Arc, Bezier, and other Curves that are generated as a function of a t-value that runs from 0.0 to 1.0).
Other than that particular use, I see no reason for limiting the domain to [0.0, 1.0]. In fact, the entire range covered by double could be permitted (except for NaN, and infinity values).
As these functions will be enhanced with various operators (plus, minus, times, etc.), shall we drop the domain range restriction?
The only immediate problem would be the proposed reverse operator. This can easily be handled by a way more general operation that does any linear remapping of the domain. The proposed reverse operation could than be written as remapDomain(from, to, scale) with parameters 0, 1, -1.
N.B. the reason for ruling out infinity values is that interpolating between a finite domain value and an infinite domain value would be problematic.
The text was updated successfully, but these errors were encountered: