Module transform
Various mathematical functions for transforming values.
Functions
big_linear (value, new_min, new_max) | Performs a linear transform on the given value to transform the value from the range -10/10 to 0/1. |
centered (value, transformation, min, max, new_min, new_max) | Performs the given transformation on the given value with the peak in center of the min and max values. |
centered_cosine (value, min, max, new_min, new_max) | Performs a cosine transformation on the given value with the peak in center of the min and max values. |
centered_linear (value, min, max, new_min, new_max) | Performs a linear transformation on the given value with the peak in center of the min and max values. |
cosine (value, min, max, new_min, new_max) | Performs a cosine transform on the given value to transform the value from one range to another. |
linear (value, min, max, new_min, new_max) | Performs a linear transform on the given value to transform the value from one range to another. |
small_linear (value, new_min, new_max) | Performs a linear transform on the given value to transform the value from the range -1/1 to 0/1. |
Functions
- big_linear (value, new_min, new_max)
-
Performs a linear transform on the given value to transform the value
from the range -10/10 to 0/1.
Parameters:
- value The value to transform.
- new_min Optional. The minimum value for the new range, defaults to 0.
- new_max Optional. The maximum value for the new range, defaults to 1.
Returns:
-
The transformed value.
- centered (value, transformation, min, max, new_min, new_max)
-
Performs the given transformation on the given value with the peak in center
of the min and max values.
Parameters:
- value The value to transform.
- transformation The transformation function, assumed to accept five values.
- min Optional. The original minimum value, defaults to -1.
- max Optional. The original maximum value, default to 1.
- new_min Optional. The minimum value for the new range, defaults to 0.
- new_max Optional. The maximum value for the new range, defaults to 1.
Returns:
-
The transformed value.
- centered_cosine (value, min, max, new_min, new_max)
-
Performs a cosine transformation on the given value with the peak in center
of the min and max values.
Parameters:
- value The value to transform.
- min Optional. The original minimum value, defaults to -1.
- max Optional. The original maximum value, default to 1.
- new_min Optional. The minimum value for the new range, defaults to 0.
- new_max Optional. The maximum value for the new range, defaults to 1.
Returns:
-
The transformed value.
- centered_linear (value, min, max, new_min, new_max)
-
Performs a linear transformation on the given value with the peak in center
of the min and max values.
Parameters:
- value The value to transform.
- min Optional. The original minimum value, defaults to -1.
- max Optional. The original maximum value, default to 1.
- new_min Optional. The minimum value for the new range, defaults to 0.
- new_max Optional. The maximum value for the new range, defaults to 1.
- cosine (value, min, max, new_min, new_max)
-
Performs a cosine transform on the given value to transform the value
from one range to another.
Parameters:
- value The value to transform.
- min Optional. The original minimum value of the range, defaults to -1.
- max Optional. The original maximum value of the range, defaults to 1.
- new_min Optional. The minimum value for the new range, defaults to 0.
- new_max Optional. The maximum value for the new range, defaults to 1.
Returns:
-
The transformed value.
- linear (value, min, max, new_min, new_max)
-
Performs a linear transform on the given value to transform the value
from one range to another.
Parameters:
- value The value to transform.
- min Optional. The original minimum value of the range, defaults to -1.
- max Optional. The original maximum value of the range, defaults to 1.
- new_min Optional. The minimum value for the new range, defaults to 0.
- new_max Optional. The maximum value for the new range, defaults to 1.
Returns:
-
The transformed value.
- small_linear (value, new_min, new_max)
-
Performs a linear transform on the given value to transform the value
from the range -1/1 to 0/1.
Parameters:
- value The value to transform.
- new_min Optional. The minimum value for the new range, defaults to 0.
- new_max Optional. The maximum value for the new range, defaults to 1.
Returns:
-
The transformed value.