While the cumulative approach is straightforward and versatile in theory, it is often not the best for many practical use cases where you want more precise control over the overall shape and details, such as in drawing or design tools.
積み重ねによるアプローチは理論上は素直で汎用的ですが、描画ツールやデザインツールなど、実際の利用シーンで、全体の形や細部をより正確に制御したい場面では必ずしも最適ではありません。
These tools usually adopt parametric approaches. In the parametric approach, a shape or curve is defined mathematically using one or more parameters. By varying these parameters, you can generate points that make up the shape. For example, if the parameter is called $t$, you can get all the points from beginning to end by moving $t$ within a certain range.
これらのツールは大抵、パラメトリックなアプローチが用いられます。パラメトリックアプローチでは、形や曲線は1つまたは複数のパラメータを使って数学的に定義され、これらのパラメータを変化させることで、形状を構成する点を生成します。例えばパラメータを $t$ とすると、この $t$ を $[0, 1]$といった一定の範囲内で変化させることで、始めから終わりまでのすべての点を取得することができます。
The most commonly used parametric curve that you probably know is the Bézier curve. But before jumping into it, let's go through several examples to get used to the idea of the parametric approach.
ベジエ曲線は最も一般的に用いられるパラメトリックな曲線です。おそらくこれを読んでいる方もご存知でしょう。しかしベジェ曲線に踏み込む前に、いくつかの例を見てパラメトリックなアプローチに慣れていきましょう。
線分
Starting from the simplest example - a straight line segment (not a curve!) A straight line segment between two points $(x_1,y_1)$ and $(x_2, y_2)$ can be parameterized as follows:
(曲線ではありませんが)最も単純な例として線分から始めましょう。 2点 $(x_1,y_1)$ と $(x_2, y_2)$ の間を結ぶ線分はパラメータを用いて下のように表すことができます。
$x(t) = (1-t)x_1 + tx_2$ $y(t) = (1-t)y_1 + ty_2$
Take a look at the demo below.
デモを見てみましょう。