File utils/transform.lua
Functions
transform.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. |
transform.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. |
transform.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. |
transform.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. |
transform.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. |
transform.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. |
transform.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
- transform.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.
Return value:
The transformed value. - transform.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.
Return value:
The transformed value. - transform.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.
Return value:
The transformed value. - transform.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.
- transform.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.
Return value:
The transformed value. - transform.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.
Return value:
The transformed value. - transform.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.
Return value:
The transformed value.