|
Author |
hbghlyj
Posted 2023-3-10 01:32
ebezier 2.2 Circles and Arcs
为了说明绘制圆弧的过程,我们明确地进行计算
我们想绘制圆的右上四分之一,端点为 $z_0 = (0, r)$ 和 $z_3 = (r, 0)$。
点 $z_1$ 和 $z_2$ 确定切线。所以我们可以将它们设为 $z_1 = (h, r)$ 和 $z_2 = (r, h)$ 其中 $h$ 为待定参数。
如果我们将这些基点代入Bernstein多项式的两个分量$$\mathcal{B}_2[t]=(1-t)^2z_0+2(1-t)tz_1+t^2z_2$$令$t=\frac12$,我们得到这个Bezier曲线的中点坐标为
\[ x\left[\frac{1}{2}\right]=y\left[\frac{1}{2}\right]=\frac{r}{2}+\frac{3h}{8}\]
令它们等于圆弧的中点的横纵坐标 $r/\sqrt{2}$,我们得到
\[ h=\frac{4}{3}\left(\sqrt{2}-1\right).\]
Fitting Arcs
The quality of representating arcs by cubic bezier curves is quite satisfactory. The differences between circles and beziers may be estimated in two ways.
- If we test the overall fit the area enclosed by
the curves is a good metric: The area of $\texttt{Carc}$ for the quarter circle
is $1/30 (-33+40\sqrt{2})r^2$ to be conferred with $\pi/4\:r^2$. This is an overshot
by just $0.028\%$!
- The pointwise fit is measured by the radial difference.
The maximum is $\cong 0.00025\,r$ (at odd multiples of $\pi/8$),
it is zero for all multiples of $\pi/4$.
|
|