Nez.Portable/Math/Mathf.cs
/// <summary>
/// mapps value (which is in the range leftMin - leftMax) to a value in the range rightMin - rightMax
/// </summary>
/// <param name="value">Value.</param>
/// <param name="leftMin">Left minimum.</param>
/// <param name="leftMax">Left max.</param>
/// <param name="rightMin">Right minimum.</param>
/// <param name="rightMax">Right max.</param>
mapps value (which is in the range leftMin - leftMax) to a value in the range rightMin - rightMax
mapps value ( which is in the range leftMin - leftMax ) to a value in the range rightMin - rightMax
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static float map(float value, float leftMin, float leftMax, float rightMin, float rightMax)
        {
            return rightMin + (value - leftMin) * (rightMax - rightMin) / (leftMax - leftMin);
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static float map ( float value , float leftMin , float leftMax , float rightMin , float rightMax ) { return rightMin + ( value - leftMin ) * ( rightMax - rightMin ) / ( leftMax - leftMin ) ; }
mapps value (which is in the range leftMin - leftMax) to a value in the range rightMin - rightMax
mapps value ( which is in the range leftMin - leftMax ) to a value in the range rightMin - rightMax
value
float
None
leftMin
float
None
leftMax
float
None
rightMin
float
None
rightMax
float
None