2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ベジェ曲線について

Posted at

ベジェ曲線とは

簡単に言えば、N+1個の制御点から得られるN字曲線である。
様々な表現方法により定義されているが、その中でも代表的なものを二つ紹介する。
以下の二つの定義の中で以下の要素を用いる。

  • 次数: $N \in \Bbb{N}$
  • パラメータ: $t \in \Bbb{R}, \ 0 \leq t \leq 1$
  • 制御点: N+1個のベクトル $ \mathbf B_0, \ \mathbf B_1, ... \ \mathbf B_N $

バーンスタイン表現

バーンスタイン基底関数$J_{N,j} (t)$を用いて、$N$次ベジェ曲線は以下のように定義される。

P(t) = \sum_{i = 0}^N \mathbf{B}_i J_{N,i}(t) = \sum_{i = 0}^N \mathbf{B}_i \begin{pmatrix}
N \\
i
\end{pmatrix}t^i (1-t)^{N-i}

ド・カステリョ(デ・カステリョ)のアルゴリズム

ベクトル $\mathbf{B}_i^r (t)$に関する漸化式を以下のように定義する。

B_i^r(t) = 
\begin{cases} 
B_i(t) & (r = 0, \quad i \in \{0, 1, \dots, N\}) \\
(1 - t)B_i^{r-1}(t) + tB_{i+1}^{r-1}(t) & (r \in \{1, \dots, N\}, \quad i \in \{0, 1, \dots, N-r\}) 
\end{cases}

この式を用いて、N次ベジェ曲線は$\mathbf{P}(t) = \mathbf{B}_0^N(t) $で定義される。

3次ベジェ曲線

直感的な操作が行えるため、グラフィックソフトなどでも用いられる。
直感的な操作ができる理由は端の制御点とその横の制御点を結ぶ線分が端の制御点からの接線となっているためである。

ベジェ曲線の実装

three.jsを用いて、ベジェ曲線を実装した。

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?