ease between 2 points

JavaScript
p = p1 + (p2 - p1) * t;
// With easing:
p = p1 + (p2 - p1) * EaseFunction(t); 

Source

Also in JavaScript: