draw a cosine curve