def cosine(w, A=1, phi=0, offset=0):
 from math import cos
 def f(i):
  return ((A * cos(((w * i) + phi))) + offset)
 return partial(_force, sequence=_advance(f))

def cosine ( w , A = 1 , phi = 0 , offset = 0 ) : from math import cos def f ( i ) : return ( ( A * cos ( ( ( w * i ) + phi ) ) ) + offset ) return partial ( _force , sequence = _advance ( f ) )
return a driver function that can advance a sequence of cosine values .