我使用此算法来计算二次贝塞尔曲线的长度: www.malczak.linuxpl/blog/quadratic- bezier-curve-length/
I use this algorithm to calculate the length of a quadratic bezier: www.malczak.linuxpl/blog/quadratic-bezier-curve-length/
但是,我想做的是计算从0到t的贝塞尔曲线的长度,其中0≤t. t < 1
However, what I wish to do is calculate the length of the bezier from 0 to t where 0 < t < 1
是否可以修改上面链接中使用的公式以获取贝塞尔曲线第一段的长度?
Is there any way to modify the formula used in the link above to get the length of the first segment of a bezier curve?
为了澄清,我不是在寻找q(0)和q(t)之间的距离,而是寻找这些点之间的弧长.
Just to clarify, I'm not looking for the distance between q(0) and q(t) but the length of the arc that goes between these points.
(我不希望使用自适应细分来接近长度)
(I don't wish to use adaptive subdivision to aproximate the length)
推荐答案由于我确定该变量t的情况下将存在类似的表单解决方案-我扩展了链接中给出的解决方案.
Since I was sure a similar form solution would exist for that variable t case - I extended the solution given in the link.
从链接中的方程式开始:
Starting from the equation in the link:
我们可以写成
b = B/(2A)和c = C/A的地方.
然后转换u = t + b我们得到
k = c - b^2
现在,我们可以使用链接中的积分标识来获取:
Now we can use the integral identity from the link to obtain:
因此,总的来说,所需的步骤是:
So, in summary, the required steps are:
更多推荐
计算二次贝塞尔曲线段的长度
发布评论