答案 0 :(得分:1)
让我们看看这是否有帮助。以下是:
f = polynomial
f' = derivative of f
N = Number of subdivisions
D = length of each subdivisions
a = x coordinate of f for the first end of the curve.
M = max of f' in the interval [a, b] where the curve is to be drawn.
k = an integer such that an error of M/k would be negligible
<强>算法强>
对于每个1 <= j <= N - 1
,请找到n(j)
,以使以下sum(j)
接近jD
的时间少于M/k
:
sum(j) = sum from i=1 to n(j) of sqrt(1 + f'(a + (i-1)/k)^2)/k
算法的想法
数量:
1/k * sqrt(1 + f'(a + (i-1)/k)^2)
是a + (i-1)/k
和a + i/k
之间曲线的近似长度。
算法的想法是总结这些小曲线段的长度,试图找出哪些曲线段足够接近D
,2D
,3D
等。