title: Given an X, how can you get the Y value on a CGPathRef?
body: <p>I'm dealing with a CGPathRef that is a Bezier Curve. I'd like to get 100 evenly spaced X, Y coordinates on the path ref.</p>
  
  <p>For instance, on this line, I'd like to get 100 Y values for evenly spaced X values.</p>
  
  <p><img src="https://i.stack.imgur.com/87R5n.png" alt="CGPathRef">
  Currently, I am creating a UIView and animating it with speed = 0.f then waiting for animation did stop and then getting the view's x,y coordinates:</p>
  
  <pre><code>CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
  pathAnimation.calculationMode = kCAAnimationLinear;
  pathAnimation.fillMode = kCAFillModeForwards;
  pathAnimation.removedOnCompletion = NO;
  pathAnimation.speed = 0.f;
  pathAnimation.duration = 100;
  // Get position 50
  pathAnimation.timeOffset = 50;
  pathAnimation.path = path;
  pathAnimation.delegate = (id)self;
  </code></pre>
  
  <p>However, this has very poor performance when it's done a lot -- not to mention it's incredibly hacky. Is there a better way to do this?</p>