Using cosine function for interpolation