interpolate

fun interpolate(from: Square, to: Square, by: Float)

Sets this square with the result of interpolation from one square to another square by a factor.

Parameters

from

the square from which the interpolation starts.

to

the square at which the interpolation ends.

by

the interpolation factor which is expected to be in the range of [0, 1].