1
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?

2次ベジェ曲線の弧長の計算

1
Last updated at Posted at 2026-03-10

3つの平面$\mathbb{R}^2$ 上の点$(x_1, y_1), (x_2, y_2), (x_3, y_3)$を考える.
$(x_1, y_1)$を始点として$(x_3, y_3)$を終点, $(x_2, y_2)$を制御点とする2次ベジェ曲線$c(t)$は媒介変数表示を用いて

$$
c(t) = \begin{pmatrix}
(1-t)^2 x_1 + 2t(1-t)x_2 + t^2 x_3 \\
(1-t)^2 y_1 + 2t(1-t)y_2 + t^2 y_3
\end{pmatrix} \quad (t \in [0, 1])
$$

で定義されます.
この記事ではこの曲線の弧長$L$を計算してみます.

主張

$1.$ $(x_2, y_2)$が$(x_1, y_1)$と$(x_3, y_3)$の中点のとき

$$
L = \sqrt{(x_1-x_3)^2 + (y_1-y_3)^2} .
$$

$2.$ そうでないとき

$$
\begin{aligned}
a &= x_1 - 2x_2 + x_3, \\
b &= x_2 - x_1, \\
c &= y_1 - 2y_2 + y_3, \\
d &= y_2 - y_1, \\
p &= a^2 + c^2 > 0 \\
q &= \frac{ab+cd}{a^2+c^2} = \frac{ab+cd}{p}, \\
r &= \frac{ad-bc}{a^2+c^2} = \frac{ad-bc}{p}
\end{aligned}
$$

とおくと

$$
L = \begin{cases}
\sqrt{p} ((q+1)|q+1| - q|q|) & (r = 0 \text{の時}) \\
\sqrt{p} ((q+1)\sqrt{(q+1)^2 + r^2} - q\sqrt{q^2 + r^2} + \\
\quad\quad r^2(\log(q+1 + \sqrt{(q+1)^2 + r^2}) - \log(q + \sqrt{q^2 + r^2}))) & (\text{そうではないとき})
\end{cases}
$$

が成り立つ.

証明. 1. このとき, このベジェ曲線は始点を$(x_1, y_1)$, 終点を$(x_3, y_3)$としている直線になっていることを示す.
$ x_1 + x_3 = 2x_2, y_1 + y_3 = 2y_2$なので

$$
\begin{aligned}
x(t)
&= (1-t)^2x_1 + t(1-t)(x_1 + x_3) + t^2x_3 \\
&= (1-t)^2x_1 + t(1-t)x_1 + t(1-t)x_3 + t^2x_3 \\
&= (1-t)(1-t+t)x_1 + t(1-t+t)x_3 \\
&= (1-t)x_1 + tx_3
\end{aligned}
$$

となる. 同様に $ y(t) = (1-t)y_1 + ty_3$を満たす.
以上によって このベジェ曲線は始点を$(x_1, y_1)$として, 終点を$(x_3, y_3)$ とする直線である.
したがって 弧長は

$$
L = \sqrt{(x_1 - x_3)^2 + (y_1 - y_3)^2}
$$

を満たす.

2. $x(t), y(t)$を微分すると

$$
\begin{aligned}
\frac{dx}{dt} &= 2t(x_1 - 2x_2 + x_3) + 2(x_2 - x_1) \\
\frac{dy}{dt} &= 2t(y_1-2y_2+y_3) + 2(y_2 - y_1)
\end{aligned}
$$

となる. したがって

$$
\begin{aligned}
\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}
&= 2\sqrt{(t(x_1 - 2x_2 + x_3) + (x_2 - x_1))^2 + (t(y_1 - 2y_2 + y_3) + (y_2 - y_1))^2}.
\end{aligned}
$$

$ a=x_1-2x_2+x_3, b=x_2-x_1, c=y_1-2y_2+y_3, d=y_2-y_1$ とおいて, 上式の平方根の中を平方完成すると

$$
\begin{aligned}
(at+b)^2 + (ct+d)^2
&= t^2(a^2 + c^2) + 2t(ab + cd) + b^2+d^2 \\
&= (a^2+c^2)\left(t + \frac{ab+cd}{a^2+c^2}\right)^2 - \frac{(ab+cd)^2}{a^2+c^2} + b^2+d^2
\end{aligned}
$$

また

$$
\begin{aligned}
-(ab+cd)^2 + (a^2+c^2)(b^2+d^2)
&= -(a^2b^2 + c^2d^2 + 2abcd) + (a^2b^2 + c^2d^2 + b^2c^2 + a^2d^2) \\
&= a^2d^2 + b^2c^2 - 2abcd \\
&= (ad-bc)^2.
\end{aligned}
$$

よって,

$$
\begin{aligned}
(at+b)^2 + (ct+d)^2
&= (a^2+c^2)\left(t + \frac{ab+cd}{a^2+c^2} \right)^2 + \frac{(ad-bc)^2}{a^2+c^2} \\
&= (a^2+c^2)\left(\left(t + \frac{ab+cd}{a^2+c^2}\right)^2 + \left(\frac{ad-bc}{a^2+c^2}\right)^2\right).
\end{aligned}
$$

したがって, $p=a^2+c^2>0, q=(ab+cd)/(a^2+c^2), r=(ad-bc)/(a^2+c^2)$とおくと

$$
\begin{aligned}
(at+b)^2 + (ct+d)^2
&= p((t+q)^2 + r^2).
\end{aligned}
$$

以上によって

$$
\begin{aligned}
L
&= \int_0^1 \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2} dt \\
&= 2\int_0^1 \sqrt{p((t+q)^2 + r^2)} dt \\
&= 2\sqrt{p} \int_0^1 \sqrt{(t+q)^2 + r^2} dt.
\end{aligned}
$$

$r=0$のとき

$$
\int |t| dt = \frac1{2} t|t| + C (C\text{は積分定数})
$$
に注意して

$$
\begin{aligned}
L
&= 2\sqrt{p} \int_0^1 \sqrt{(t+q)^2} dt \\
&= 2\sqrt{p}\int_0^1 |t+q|dt \\
&= \sqrt{p} \left.(t+q)|(t+q)|\right|_{t=0}^1 \\
&= \sqrt{p} ((q+1)|q+1| - q|q|).
\end{aligned}
$$

$r \neq 0$のとき

$正数\rho \neq 0$ に対して

$$
\int \sqrt{x^2 + \rho^2}dx
= \frac{1}{2} (x\sqrt{x^2 + \rho^2} + \rho^2\log(x + \sqrt{x^2 + \rho^2})) + C (C\text{は積分定数})
$$
が成り立つ (参考URL)ことに注意する.
$u = t + q$ とおくと, $du = dt$ が成り立つので

$$
\begin{aligned}
L
&= 2\sqrt{p} \int_0^1 \sqrt{(t+q)^2 + r^2} dt \\
&= 2\sqrt{p}\int_q^{q+1} \sqrt{u^2 + r^2} du \\
&= \sqrt{p}\left.\left( u\sqrt{u^2 + r^2} + r^2\log(u + \sqrt{u^2 + r^2})\right) \right|_{u=q}^{q+1} \\
&= \sqrt{p} ((q+1)\sqrt{(q+1)^2 + r^2} - q\sqrt{q^2 + r^2} + \\
& \quad\quad\quad r^2(\log(q+1 + \sqrt{(q+1)^2 + r^2}) - \log(q + \sqrt{q^2 + r^2}))).
\end{aligned}
$$

1
0
1

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
1
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?