Shatrughna
0
Q:

cosine interpolation

def cosineInterpolate(y1, y2, x)
{
   xv = (1 - cos(x * 3.1415927)) / 2
   return y1 + (y2 - y1) * xv
}
1
def linearInterpolate(y1, y2, x):
  return y1 + (y2 - y1) * x
  
1
def cosineInterpolate(y1, y2, x):
   xv = (1 - cos(x * 3.1415927)) / 2
   return y1 + (y2 - y1) * xv
0

New to Communities?

Join the community