title: Javascript canvas curve with fixed length
body: <p>I want to draw any ( randomized ) curve, with given:</p>
  
  <ul>
  <li>start point</li>
  <li>end point</li>
  <li>curve length</li>
  </ul>
  
  <p>How can I do such a thing limited by canvas boundaries, plus the curve can not cross. I was trying to find some solution but I can't figure this out. Thanks for your time.</p>
  
  <p>Here is more detailed view of what I want to accomplish:</p>
  
  <p>This is Quadratic curve drawn on canvas. Everything is fine. Question is, how to draw this without all the points, just with the fixed length in pixels, random points, bounded by canvas size and non crossing.</p>
  
  <p><img src="https://i.stack.imgur.com/TK8Cz.png" alt="enter image description here"></p>
  
  <p>The code could look something like this:</p>
  
  <pre><code>function fixedCurve( A, B, length ){
      for(int i = A; i &lt; B; i++){
          //Calculate random point with propper distance to get first base point, random direction could be calculated before loop.
          //Basicly this loop should calculate integrate of the curve and draw it each step.
      }
  }
  </code></pre>