cosine interpolation

Solutions on MaxInterview for cosine interpolation by the best coders in the world

showing results for - "cosine interpolation"
Indiana
25 May 2020
1def cosineInterpolate(y1, y2, x)
2{
3   xv = (1 - cos(x * 3.1415927)) / 2
4   return y1 + (y2 - y1) * xv
5}
6
Mateo
22 Feb 2016
1def linearInterpolate(y1, y2, x):
2  return y1 + (y2 - y1) * x
3  
Leonie
16 Jan 2020
1def cosineInterpolate(y1, y2, x):
2   xv = (1 - cos(x * 3.1415927)) / 2
3   return y1 + (y2 - y1) * xv