title: Calculate the control points for cubic Bézier curve from an arc
body: <p>I have an geometric arc defined by the two end points (P0 = x1,y1 and P4 = x2,y2) and either the radius R or the center of the arc (C = xc, yc).   I need to calculate the two control points P2, P3 for the cubic Bézier curve in javascript. In my particular case the arc angle will be less than 90 degrees.</p>
  
  <p>I have search the internet and stackoverflow and any solutions are incomplete, not generalized for an arc of indeterminate angle, or too complex for me to understand.</p>
  
  <p>Does anyone have any javascript code or pseudo code that would help?  I previously asked a similar question but improperly referred to the Bézier curve as quadratic when I need a cubic Bézier curve.</p>