https://youtu.be/NzjF1pdlK7Y

float Lerp( float a, float b, float t ) {
	return (1.0f - t ) * a + b * t;
}

float InvLerp( float a, float b, float v ) {
	return ( v - a ) / ( b - a );
}

float Remap( float iMin, float iMax, float oMin, float oMax, float v ) {
	float t = InvLerp( iMin, iMax, V );
	return Lerp( oMin, oMax, t ):
}

In this function for Lerping, Inverse Lerping, and remapping we establish two ranges, one for the inputs (iMin and iMax) and one for the outputs (oMin and oMax).