Cosine ramp function.