title: How Can I accelerate/Slow down the rotation of a button in CABasicAnimation
body: <p>I want my planet to accelerate its motion when it is closer to the sun and slow down when it is farther away from the sun.. Please help me! Thank you</p>
  
  <pre><code>CABasicAnimation* rotationAnimation;
  
  rotationAnimation=[CABasicAnimationanimationWithKeyPath:@"transform.rotation.z"];
  rotationAnimation.toValue = [NSNumber numberWithFloat: -M_PI * 2.0 /* full rotation*/ * 1/period ];//multiply more to add speed
  rotationAnimation.duration = 15;
  rotationAnimation.cumulative = YES;
  rotationAnimation.repeatCount =  HUGE_VALF;
  [planet.layer addAnimation:rotationAnimation forKey:@"orbit"];
  </code></pre>