Function to calculate a normalized value between 0 and 1.
Syntax |
real normalize (real value, real offset, real cycle) |
---|---|
value |
Expression that provides the data to be normalized |
offset |
Expression giving the start position of the cycle |
cycle |
Expression providing the length of the reference cycle |
Result |
Returns a value between 0.0 (included) and 1.0 (excluded), calculated by the following formula: result = abs_mod ((value - offset), cycle) |
Validity |
Rule, Task |
Note |
If the input parameter value exactly coincides with the start/end of a cycle, the normalize() function always returns 0.0 . The function therefore never returns the value 1.0 |
Example of use:
|