INVERSELERP
How far a value is from one to another, as a part of the way: the opposite of LERP.
Syntax
INVERSELERP(a,b,value)
| Argument | Meaning |
|---|---|
| a, b | Two numbers, or two positions. |
| value | A number between them (or beyond), or a position. |
Result
A number: 0 at a, 1 at b, 0.5 half way; less than 0 or more than 1 beyond them.
Examples
In the example drawing:
| Expression | Gives |
|---|---|
INVERSELERP(0,10,4) |
0.4 |
INVERSELERP(1/4,3/4,1/2) |
1/2 |
INVERSELERP(1',2',1'3") |
1/4 |
INVERSELERP(P0,P1,[125,40]) |
0.25 |
Notes
Fractions, and feet and inches, give a fraction, exactly. For positions, it is the part of the way from a to b of the point on the line through them nearest the value. a and b must differ.