Added cosine interpolation.
Added general form of interpolation.