top of page

LOwORP

by XR_XharpRazor

Quick smol tool for LERPing (Linear IntERPolation)

A

t = 180/360

t = 0

t = 1

B

-

-

Other Facts

Smol bite size infos about LERPing

Approach 1

Difference :
B - A

A part of the Difference :
( B - A ) * t

now with a boost of Starting Point:
V = ( B - A ) * t + A

Approach 2

Asumme to start with a length of 1 :
and then we break it into 2 parts
t & 1 - t

When t=0, A will have full influence
When t=1, A will have no influence

( 1 - t ) * A

When t=0, B will have no influence
When t=1, B will have full influence

B

if we combine them, we can have:
V = ( 1 - t ) * B

Both Approach are atually the same

V = ( B - A ) * t + A

V = ( 1 - t ) * B

V = Bt - At + A

V = ( Bt - At ) + A

V = A - t) + Bt

Inverse LERP
Based on A, B, V, find t :

V = ( B - A ) * t + A
V
= ( B - A ) * t
 = ( V
) / ( B - A )

LERP Mapping
Mapping a range to another range :
("i" as "in", "o" as "out")


= ( Vi Ai ) / ( Bi - Ai )
Vo = ( Bo - Ao ) * t + Ao

​
or by combining both of them, we can have :
Vo = (Vi-Ai)(Bo-Ao)/(Bi-Ai) + Ao

bottom of page