The following mathematical functions are useful for smooth movements of two-dimensional objects.
f(x) = \frac{-2k}{n^3} * x^3 + \frac{3k}{n^2} * x^2
Example with k=3 and n=2:
k=3
n=2
Graph starts at origin (0,0) and ends at (n,k) with a smooth transition between these points.
(0,0)
(n,k)
f(x) = \frac{2k}{n^3} * x^3 - \frac{3k}{n^2} * x^2 + k
Example with k=2 and n=3:
k=2
n=3
Graph starts at (0,k) and ends at (n,0) with a smooth transition between these points.
(0,k)
(n,0)