35. Curves
Dated: 04-07-2025
Parametric Equations of a Curve
A parametric curve
is one whose defining equations are given in terms of a single, common, independent variable called the parametric variable
.
A 3D curve
will have \(x, y\) and \(z\) coordinates, each of which could be defined by a function
of an independent variable \(u\) such as
\[x = x(u), \ y = y(u), \ z = z(u)\]
Let \(p\) be a vector
then
\[
\vec p (u) =
\begin{bmatrix}
x(u) & y(u) & z(u)
\end{bmatrix}
\]
Plane Curves
\[\vec x (u)= a_x u^2 + b_x u + c\]
\[\vec y (u)= a_y u^2 + b_y u + c\]
\[\vec z (u)= a_z u^2 + b_z u + c\]
We can combine these into
\[\vec p(u) = au^2 + bu + c\]
We will bound \(u\) to \([0, 1]\) and each coefficient (i.e. \(a, b\) and \(c\)) have their three components
\[
a =
\begin{bmatrix}
a_x & a_y & a_z
\end{bmatrix}
\]
\[
b =
\begin{bmatrix}
b_x & b_y & b_z
\end{bmatrix}
\]
\[
c =
\begin{bmatrix}
c_x & c_y & c_z
\end{bmatrix}
\]
We can use 3 points to define a unique curve.
- Starting point (\(u = 0\))
- Intermediate point (\(u = 0.5\))
- Ending point (\(u = 1\))
\[
p_0 =
\begin{bmatrix}
x_0 & y_0 & z_0
\end{bmatrix}
\]
\[
p_{0.5} =
\begin{bmatrix}
x_{0.5} & y_{0.5} & z_{0.5}
\end{bmatrix}
\]
\[
p_1 =
\begin{bmatrix}
x_{1} & y_{1} & z_{1}
\end{bmatrix}
\]
The subscripts represent the \(u\) values.
Now try solving the equations for \(\vec x(u)\)
\[x_0 = c_x\]
\[x_{0.5} = 0.25a_x + 0.5 b_x + c_x\]
\[x_1 = a_x + b_x + c_x\]
Solve for \(a_x, b_x\) and \(c_x\) and we have
\[a_x = 2x_0 - 4x_{0.5} + 2x_1\]
\[b_x = -3x_0 + 4x_{0.5} + x_1\]
\[c_x = x_0\]
Submitting these back into \(\vec x(u)\), we get
\[
x(u) = (2x_0 - 4x_{0.5} + 2x_1) u^2 + (-3x_0 + 4x_{0.5} - x_1)u + x_0
\]
\[
= (2u^2 - 3u + 1) x_0 + (-4u^2 + 4u)x_{0.5} + (2u^2 - u) x_1
\]
Combining similar expressions for \(\vec y(u)\) and \(\vec z(u)\), we have
\[
\vec P(u) = (2u^2 - 3u + 1) p_0 + (-4u^2 + 4u)p_{0.5} + (2u^2 - u) p_1
\]
We can rewrite \(\vec p(u)\) as follows
\[
\begin{bmatrix} u^2 & u & 1 \end{bmatrix} \begin{bmatrix} a \\ b \\ c \end{bmatrix} = au^2 + bu + c
\]
\[
U = \begin{bmatrix} u^2 & u & 1 \end{bmatrix}
\]
\[
A = \begin{bmatrix} a & b & c \end{bmatrix}^T
\]
\[\vec p(u) = UA\]
\[
A = \begin{bmatrix}
a \\
b \\
c
\end{bmatrix} = \begin{bmatrix}
a_x & a_y & a_z \\
b_x & b_y & b_z \\
c_x & c_y & c_z
\end{bmatrix}
\]
Now we will rewrite \(\vec P(u)\) in similar way
\[
\vec P(u) = \begin{bmatrix} (2u^2 - 3u + 1) & (-4u^2 + 4u) & (2u^2 - u) \end{bmatrix} \begin{bmatrix} p_0 \\ p_{0.5} \\ p_1 \end{bmatrix}
\]
\[
F = \begin{bmatrix} (2u^2 - 3u + 1) & (-4u^2 + 4u) & (2u^2 - u) \end{bmatrix}
\]
\[
P = \begin{bmatrix}
p_0 \\
p_{0.5} \\
p_1
\end{bmatrix} = \begin{bmatrix}
x_0 & y_0 & z_0 \\
x_{0.5} & y_{0.5} & z_{0.5} \\
x_1 & y_1 & z_1
\end{bmatrix}
\]
\[\vec P(u) = FP\]
Because the 2 are equations for same curve
\[\vec p(u) = \vec P(u)\]
\[UA = FP\]
We can decompose \(F\) into
\[
F = \begin{bmatrix} u^2 & u & 1 \end{bmatrix} \begin{bmatrix}
2 & -4 & 2 \\
-3 & 4 & -1 \\
1 & 0 & 0
\end{bmatrix}
\]
Let
\[
M = \begin{bmatrix}
2 & -4 & 2 \\
-3 & 4 & -1 \\
1 & 0 & 0
\end{bmatrix}
\]
So
\[F = UM\]
Therefore, we have
\[UMP = UA\]
\[\implies MP = A\]
\[\implies M^{-1}MP = M^{-1}A\]
The matrix
\(M\) is called a basis transformation matrix
, and \(F\) is called a blending function matrix
.
References