I want to draw any ( randomized ) curve, with given:
- start point
- end point
- curve length
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.
Here is more detailed view of what I want to accomplish:
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.
The code could look something like this:
function fixedCurve( A, B, length ){
for(int i = A; i < 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.
}
}