Drahcir Drahcir - 5 months ago 8
Javascript Question

What does the variable "k" stand for?

I use the tween.js library, it contains some built in easing functions such as this one:

Quadratic: {
In: function (k) {
return k * k;
}
};


The user guide describes the variable
k
as:


  • k
    : the easing progress, or how far along the duration of the tween we are. Allowed values are in the range [0, 1].



My question is why
k
, what does this letter stand for?
If I'd written the function myself, I'd have named it
p
meaning either progress or percentage.

Answer

Alright, I wrote the code (a classic simplification of the classic Penner easing equations), and honestly I don't remember why I chose k. It used to be my default variable name for a ratio between 0 and 1. No good reason come to my mind.