title: How to determine the bezier control points from calculated points with lossy approximation?
body: <p>I have a question about calculating the bezier controls for a curve. The problem is as the following image shows:</p>
  
  <p><a href="https://i.stack.imgur.com/vmgSK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vmgSK.png" alt="Problem bezier curve"></a></p>
  
  <p>I have the red points in an ordered list, including C and D. I need to find F and E. The problem is that not every point has to be on the curve (the curve does not need to pass through any point, except for start and end). It just has to be an "approximation".</p>
  
  <p>I've already read about the following:</p>
  
  <ul>
  <li><a href="http://blog.sklambert.com/finding-the-control-points-of-a-bezier-curve/" rel="nofollow noreferrer">Finding the control point of bezier curves</a> - only works with horizontal aligned handles, I don't have a midpoint to start from. Does also only find the user-visible control points, not F and E</li>
  <li><a href="https://www.cs.bgu.ac.il/~leonid/na105/Splines/Lee.pdf" rel="nofollow noreferrer">Parametric reconstruction of a NURBS curve</a> - that's fine if you want to interpolate between the red points, but that's not my goal</li>
  </ul>
  
  <p>So my thought on how to solve this was:</p>
  
  <ol>
  <li>Calculate the furthest point from a line through C and D</li>
  <li>If the number of points is even, look at the previous and next point in the list, determine which one is further away from the imaginary line and calculate the midpoint between them</li>
  <li>Three points are not enough to get the shape of the curve, I need the value at 25% and 75%. Luckily there are several methods for determining this: uniformly spaced method, arc length and centripedal method.</li>
  <li>Now I have 5 points (begin, 25%, mid, 75%, end) to describe my curve. I know the t values for each one. The curve should look like this:</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/LsTSb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LsTSb.png" alt="maybe solution"></a></p>
  
  <p>From this, I need to somehow insert the points into the bezier formula and then reverse-calculate the control points ... how?</p>
  
  <p>Thanks in advance for any hints.</p>