title: 'fast' bezier curve length python library
body: <p>To calculate the length of a bezier curve, I have been using pyx.</p>
  
  <pre><code>from pyx import path, unit
  bez = path.curve(p[0], p[1], p[0], p[1] + d, q[0], q[1]-d, q[0],q[1])
  edgelen = unit.tocm(bez.arclen())
  </code></pre>
  
  <p>where <code>p</code> and <code>q</code> are the endpoints of the curve and <code>d</code> is a vertical offset for the relative position of the two control points. (In my application, the curves are always "upward").</p>
  
  <p>However, I found that this library call for getting the curve length is painfully slow. Are there other python libraries that might have better performance? </p>