UNPKG
@drozdik.m/lerp
Version:
latest (1.0.1)
1.0.1
1.0.0
Collection of lerp functions.
github.com/drozdik-m/js-alpha-library
drozdik-m/js-alpha-library
@drozdik.m/lerp
/
Linear.ts
7 lines
(5 loc)
•
244 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
{
ILerpFunction
}
from
"./ILerpFunction"
;
export
let
Linear
:
ILerpFunction
=
function
(
from
:
number
,
to
:
number
,
currentFrame
:
number
,
totalFrames
:
number
):
number
{
return
(to -
from
) * currentFrame / totalFrames +
from
; }