diff --git a/docs/index.html b/docs/index.html index b0b5ed1f..83dc44c5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -38,7 +38,7 @@ - + @@ -133,7 +133,7 @@
- One of the first things people run into when they start using Bézier curves in their own programs is "I know how to draw the curve, but - how do I determine the bounding box?". It's actually reasonably straightforward to do so, but it requires having some knowledge on - exploiting math to get the values we need. For bounding boxes, we aren't actually interested in the curve itself, but only in its - "extremities": the minimum and maximum values the curve has for its x- and y-axis values. If you remember your calculus (provided you ever - took calculus, otherwise it's going to be hard to remember) we can determine function extremities using the first derivative of that - function, but this poses a problem, since our function is parametric: every axis has its own function. + 当人们开始在自己的程序中使用贝塞尔曲线时,首先遇到的问题之一是:“我虽然知道怎么画曲线,但是怎么确定包围盒?”其实做法颇为直接,但需要知道如何利用一些数学知识得到所需的值。对于包围盒而言,所需的其实并不是曲线本身,而只是曲线的“极值”——曲线的x轴和y轴分量的最小值和最大值。如果还记得微积分的话(前提是学过微积分,否则更难记),那么函数的极值可以用函数的一阶导数所确定,但由于“曲线函数”有不只一个分量,这就产生了一个问题——每个分量都有自己的函数。
+解决办法:对每个分量分别计算导数,再按照原来的分量顺序重新拼在一起。
- The solution: compute the derivative for each axis separately, and then fit them back together in the same way we do for the original. -
-- Let's look at how a parametric Bézier curve "splits up" into two normal functions, one for the x-axis and one for the y-axis. Note the - leftmost figure is again an interactive curve, without labeled axes (you get coordinates in the graph instead). The center and rightmost - figures are the component functions for computing the x-axis value, given a value for t (between 0 and 1 inclusive), and the y-axis - value, respectively. -
-- If you move points in a curve sideways, you should only see the middle graph change; likewise, moving points vertically should only show a - change in the right graph. + 以下演示参数化的贝塞尔曲线如何“分解”为两个正常的函数,一个对应于x轴,一个对应于y轴。注意左侧的图像依然是可交互的曲线,但没有标出坐标轴(坐标显示在图中);中间和右侧的图像是分量函数,分别对应于指定t值(介于0和1之间,含端点)后求出的x轴和y轴分量。
+如果水平移动曲线上的点,那么应当只有中间的图像在变化;同样,如果竖直移动曲线上的点,那么应当只有右侧的图像在变化。