$ \def \half {\frac{1}{2}} \def \kwart {\frac{1}{4}} \def \achtste {\frac{1}{8}} \def \hieruit {\quad \Longrightarrow \quad} \def \EN {\quad \mbox{and} \quad} $

Parabolic Curves

The parameter representation of a linear line segment may be given by: \begin{eqnarray*} x = v_x.t + s_x \\ y = v_y.t + s_y \end{eqnarray*} Physically speaking, the quantity $\vec{s} = (s_x,s_y)$ may be interpreted as an initial position, the quantity $\vec{v} = (v_x,v_y)$ may be interpreted as a (constant) velocity, and the quantity $t$ may be interpreted as time.
Multiply the first equation with $v_y$ and the second with $v_x$. Substract: \begin{eqnarray*} v_y.(x-s_x) = v_y.v_x.t \\ v_x.(y-s_y) = v_x.v_y.t \\ v_y.(x-s_x) - v_x.(y-s_y) = 0 \end{eqnarray*} Which indeed is the equation of a straight line.
Replace the linear relationship by a quadratic one: \begin{eqnarray*} x = \half a_x.t^2 + v_x.t + s_x \\ y = \half a_y.t^2 + v_y.t + s_y \end{eqnarray*} The curves which are given by this parameter representation will be subject to study here.
Physically speaking, the quantity $\vec{a} = (a_x,a_y)$ may be interpreted as an acceleration. Thus it is trivial that: \begin{eqnarray*} s_x = x(0) &\EN& s_y = y(0) \\ v_x = x'(0) &\EN& v_y = y'(0) \\ a_x = x''(0) &\EN& a_y = y''(0) \end{eqnarray*} Which actually transforms the parameter-representation into a Taylor-series expansion: \begin{eqnarray*} x = x(0) + x'(0).t + \half x''(0).t^2 \\ y = y(0) + y'(0).t + \half y''(0).t^2 \end{eqnarray*} Let's start again with: \begin{eqnarray*} x = \half a_x.t^2 + v_x.t + s_x \\ y = \half a_y.t^2 + v_y.t + s_y \end{eqnarray*} Multiply the first equation with $a_y$, the second equation with $a_x$ and substract. Then the terms with $t^2$ will cancel out: \begin{eqnarray*} a_y.(x-s_x) &=& \half a_y.a_x.t^2 + a_y.v_x.t \\ a_x.(y-s_y) &=& \half a_x.a_y.t^2 + v_y.a_x.t \\ a_y.(x-s_x) - a_x.(y-s_y) &=& a_y.v_x.t - a_x.v_y.t \end{eqnarray*} It follows that: $$ (a_y.v_x - a_x.v_y).t = a_y.(x-s_x) - a_x.(y-s_y) $$ Now suppose for a moment that $a_y.v_x - a_x.v_y = 0$. This would imply that: $a_y.(x-s_x) - a_x.(y-s_y) = 0$, which is the equation of a straight line. But straight lines have been covered already. Hence suppose in the sequel that: $$ a_y.v_x - a_x.v_y \ne 0 $$ Then the parameter $t$ can be solved and expressed in $x$ and $y$: $$ t = \frac{a_y.(x-s_x) - a_x.(y-s_y)}{a_y.v_x - a_x.v_y} $$ We seek to express the curve as an equation of the form $f(x,y) = 0$. Start with: $$ x = \half a_x.t^2 + v_x.t + s_x \EN (a_y.v_x - a_x.v_y).t = a_y.(x-s_x) - a_x.(y-s_y) $$ Multiply the first equation with $(a_y.v_x - a_x.v_y)^2$: $$ (a_y.v_x - a_x.v_y).(a_y.v_x - a_x.v_y).(x-s_x) = $$ $$ \half a_x.\left[ (a_y.v_x - a_x.v_y).t \right]^2 + v_x.(a_y.v_x - a_x.v_y) \left[ (a_y.v_x - a_x.v_y).t \right] $$ Making it ready for substituting the second equation herein: $$ (a_y.v_x - a_x.v_y).(a_y.v_x - a_x.v_y).(x-s_x) = $$ $$ \half a_x.\left[ a_y.(x-s_x) - a_x.(y-s_y) \right]^2 + v_x.(a_y.v_x - a_x.v_y) \left[ a_y.(x-s_x) - a_x.(y-s_y) \right] $$ $$ \hieruit (a_y.v_x - a_x.v_y).\left[ a_y.v_x.(x-s_x) - a_x.v_y.(x-s_x) \right] = $$ $$ \half a_x.\left[ a_y.(x-s_x) - a_x.(y-s_y) \right]^2 + (a_y.v_x - a_x.v_y) \left[ v_x.a_y.(x-s_x) - v_x.a_x.(y-s_y) \right] $$ $$ \hieruit a_x.(a_y.v_x - a_x.v_y).\left[ - v_y.(x-s_x) \right] = $$ $$ a_x.\half\left[ a_y.(x-s_x) - a_x.(y-s_y) \right]^2 + a_x.(a_y.v_x - a_x.v_y) \left[ - v_x.(y-s_y) \right] \hieruit $$ $$ \half \left[ a_y.(x-s_x) - a_x.(y-s_y) \right]^2 + (a_y.v_x - a_x.v_y) \left[ v_y.(x-s_x) - v_x.(y-s_y) \right] = 0 $$ This is the desired equation in $x$ and $y$ alone. The curve is a Conic Section with discriminant $(-2.a_y.a_x)^2 - 4.a_y^2.a_x^2 = 0$. Hence it is a Parabola. This can also be seen by rotating the coordinate system in such a way that the acceleration becomes parallel with the vertical ($y$-axis).

Quadratic Splines

Bezier splines may be defined by the following equation: $$ z(t) = (1-t)^3 \: z_0 + 3 (1-t)^2 t \: z_1 + 3 (1-t) t^2 \: z_2 + t^3 \: z_3 $$ Where $z = z + i.y$ is a vector in the complex plane and $0 \le t \le 1$ is the running parameter. The spline is defined by four so-called control points $(z_0,z_1,z_2,z_3)$. Two of these, $z_0$ and $z_3$, are on the curve. The other two, $z_1$ and $z_2$, lie on the tangent lines in $z_0$ and $z_3$ respectively. All of these facts are well known.
The simplest possible spline could be defined as: $$ z(t) = (1-t) \: z_0 + t \: z_1 $$ Which is simply a straight line segment from $z_0$ to $z_1$, where the running paramter is given by $0 \le t \le 1$. Alternatively, one could define the same object by: $$ z(t) = (\half-t) \: z_0 + (\half+t) \: z_1 $$ Where the running parameter is given by $-\half \le t \le +\half$. Analogously, the third order curve could have been defined by: $$ z(t) = (\half-t)^3 \: z_0 + 3 (\half-t)^2 (\half+t) \: z_1 + 3 (\half-t) (\half+t)^2 \: z_2 + (\half+t)^3 \: z_3 $$ $$ \mbox{where:} \qquad -\half \le t \le +\half $$ But instead of jumping from a first order to a third order curve, why shouldn't people give some attention to the second order case, the quadratic spline: $$ z(t) = (\half-t)^2 \: z_0 + 2 (\half-t) (\half+t) \: z_1 + (\half+t)^2 \: z_2 $$ $$ \mbox{where:} \qquad -\half \le t \le +\half $$ It follows that: $$ z(-\half) = z_0 \EN z(+\half) = z_2 $$ Meaning that the end-points lie on the curve. Now take the first derivative: $$ z'(t) = -2 (\half-t) \: z_0 - 2 (\half+t) \: z_1 + 2 (\half-t) \: z_1 + 2 (\half+t) \: z_2 $$ $$ = 2 (\half-t) (z_1 - z_0) + 2 (\half + t) (z_2 - z_1) $$ And specify again for the boundaries, then: $$ z'(-\half) = +2 (z_1-z_0) \EN z'(+\half) = -2 (z_1-z_2) $$ Meaning that the tangent in $z_0$ points towards $z_1$ and the tangent in $z_2$ points towards the opposite direction.
If we specify $z(t)$ and $z'(t)$ for $t=0$, then: $$ z(0) = \kwart z_0 + \half z_1 + \kwart z_2 \EN z'(0) = (z_1 - z_0) + (z_2 - z_1) = (z_2 - z_0) $$ It is certain that $z(0)$ lies on the curve. Furthermore, the tangent $z'(0)$ is pointing towards the middle of the line segment joining $z_0$ and $z_1$, because: $$ \half (z_1 + z_0) - z(0) = \half (z_1 + z_0) - (\kwart z_0 + \half z_1 + \kwart z_2) = \kwart (z_0 - z_2) = - \kwart z'(0) $$ This means that the piece of curve between $z_0$ and $z(0)$ may be considered again as a quadratic spline, with end points $z_0$ and $z(0)$ and control point $(z_0+z_1)/2$. We will show that such is the case, indeed.
At first, a new running parameter $u$ will be introduced, in such a way that: $$ z(t = -\half) = z(u = -\half) \EN z(t = 0) = z(u = +\half) $$ As follows. Suppose that the relationship between $t$ and $u$ is linear: $$ t = a u + b \hieruit -\half = -\half a + b \EN 0 = +\half a + b $$ $$ \hieruit 2 b = - \half \EN a = -2 b \hieruit t = \half u - \kwart $$ Substitute into the equation for the spline: $$ z(t) = (\half-t)^2 z_0 + 2 (\half-t) (\half+t) z_1 + (\half+t)^2 z_2 $$ Giving: $$ z(u) = (\frac{3}{4}-\half u)^2 z_0 + 2 (\frac{3}{4}-\half u) (\kwart + \half u) z_1 + (\kwart + \half u)^2 z_2 $$ According to our educated guess, the new spline would be defined by: $$ z(u) = (\half-u)^2 p_0 + 2 (\half-u) (\half+u) p_1 + (\half+u)^2 p_2 $$ Where the new end-points $p_0,p_2$ and the control point $p_1$ are given by: $$ p_0 = z_0 \EN p_1 = \half(z_0 + z_1) \EN p_2 = \kwart z_0 + \half z_1 + \kwart z_2 $$ Hence we must prove that the following expressions are identical: $$ (\frac{3}{4}-\half u)^2 z_0 + 2 (\frac{3}{4}-\half u) (\kwart + \half u) z_1 + (\kwart + \half u)^2 z_2 = $$ $$ (\half-u)^2 z_0 + 2 (\half-u) (\half+u) \half (z_0 + z_1) + (\half+u)^2 (\kwart z_0 + \half z_1 + \kwart z_2) $$ Collect the terms with $z_0$: $$ (\frac{3}{4}-\half u)^2 = \frac{9}{16} - \frac{3}{4} u + \kwart u^2 = $$ $$ (\half-u)^2 + 2 (\half-u) (\half+u) \half + (\half+u)^2 \kwart = \kwart + \kwart + \frac{1}{16} - u + \kwart u + u^2 - u^2 + \kwart u^2 $$ Collect the terms with $z_1$: $$ 2 (\frac{3}{4}-\half u) (\kwart+\half u) = \frac{3}{8} + \half u - \half u^2 = $$ $$ 2 (\half-u) (\half+u) \half + (\half+u)^2 \half = \kwart + \frac{1}{8} + \half u - u^2 + \half u^2 $$ Collect the terms with $z_2$, at last: $$ (\kwart + \half u)^2 = (\half+u)^2 \kwart $$ This completes the proof of our assertion that z(u) is again a quadratic spline with an old and a new end-point and a new control point.
The exact locations of the new points give rise to an interesting algorithm for constructing the spline geometrically. (This algorithm is quite analogous to one for the 3rd order spline.) It reads as follows. Let $z_0$ and $z_2$ be the end points of a quadratic spline and $z_1$ its control point. Construct new points: $$ p_0 := z_0 \EN p_1 := (z_0+z_1)/2 \EN p_2 := \frac{\half (z_0+z_1) + \half (z_1+z_2)}{2} $$ For the other half of the spline, the algorithm reads: $$ p_0 := p_2 \quad \mbox{: value as above} \EN p_2 := z_2 \EN p_1 := (z_2+z_1)/2 $$ The process can be repeated recursively. In this way, we may successively find many points on the spline. Therefore, the algorithm may be quite useful for the purpose of visualization, for example.
Quadratic (or conic) splines are Parabolic Curves. This can be inferred easily by collecting terms with equal powers of $t$ in the definition equation: $$ z(t) = (\half-t)^2 \: z_0 + 2 (\half-t) (\half+t) \: z_1 + (\half+t)^2 \: z_2 $$ Giving: $$ z(t) = \half 2 (z_0 - 2 z_1 + z_2) \: t^2 + (z_2 - z_0) \: t + \kwart (z_0 + 2 z_1 + z_2) $$ The above is part of a Taylor-series expansion. Hence it can be concluded that: \begin{eqnarray*} z(0) = \kwart (z_0 + 2 z_1 + z_2) = \vec{s} \\ z'(0) = (z_2 - z_0) = \vec{v} \\ z''(0) = 2 (z_0 - 2 z_1 + z_2) = \vec{a} \end{eqnarray*} See the paragraph about Parabolic Curves for a physical meaning of the quantities $\vec{a}$ , $\vec{v}$ and $\vec{s}$ . The relationship between $z_0$ , $z_1$ , $z_2$ on one side, and $z(0)$ , $z'(0)$ , $z''(0)$ on the other side, can be inverted: $$ \left[ \begin{array}{c} z(0) \\ z'(0) \\ z''(0) \end{array} \right] = \left[ \begin{array}{ccc} 1/4 & 1/2 & 1/4 \\ -1 & 0 & 1 \\ 2 & -4 & 2 \end{array} \right] \left[ \begin{array}{c} z_0 \\ z_1 \\ z_2 \end{array} \right] \hieruit $$ $$ \left[ \begin{array}{c} z_0 \\ z_1 \\ z_2 \end{array} \right] = \left[ \begin{array}{ccc} 1 & -1/2 & +1/8 \\ 1 & 0 & -1/8 \\ 1 & +1/2 & +1/8 \end{array} \right] \left[ \begin{array}{c} z(0) \\ z'(0) \\ z''(0) \end{array} \right] $$ This is quite analogous to the FEM $\leftrightarrow$ FDM base-transistion in Numerical Analysis and is sometimes called a transition between Analytic and Geometry Space. Written more explicitly for the right-hand side: \begin{eqnarray*} z_0 &=& z(0) - \half z'(0) + \achtste z''(0) \\ z_1 &=& z(0) - \achtste z''(0) \\ z_2 &=& z(0) + \half z'(0) + \achtste z''(0) \end{eqnarray*} Quite a useful application of the above is the smoothing of contour lines. Our algorithms, so far, invlove the generation of straight line segments, which are plotted as such. The appearance of (closed) contour lines may be improved with the use of quadratic splines. As follows. Determine the middle of any straight line segment and consider all midpoints as the end-point of quadratic splines. Then it is clear that the control points are just the vertices of the straight line segments. Contours can be smoothed now by applying the above algorithm.

Length of a Conic Spline

Let the (plane) coordinates $(x,y)$ of a conic spline be given by: $$ x = \half a_x t^2 + v_x t + s_x \EN y = \half a_y t^2 + v_y t + s_y $$ Speaking in physical terms, quantities involved can be interprested as follows: \begin{eqnarray*} t & = & \mbox{time} \\ \vec{s} = (s_x,s_y) & = & \mbox{initial position} \\ \vec{v} = (v_x,v_y) & = & \mbox{velocity} \\ \vec{a} = (a_x,a_y) & = & \mbox{acceleration} \end{eqnarray*} The length of the conic spline is given by the integral: $$ L = \int_{t_1}^{t_2} \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2} \; dt = \int_{t_1}^{t_2} \sqrt{(a_x t + v_x)^2 + (a_y t + v_y)^2} \; dt $$ Working out terms under the square root: $$ (a_x t + v_x)^2 + (a_y t + v_y)^2 = $$ $$ (a_x^2 + a_y^2) t^2 + 2(a_x v_x + a_y v_y) t + (v_x^2 + v_y^2) = $$ $$ (a_x^2 + a_y^2) \left[ t^2 + 2 \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} t + \left( \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right)^2 \right] $$ $$ - \frac{(a_x v_x + a_y v_y)^2}{a_x^2 + a_y^2} + \frac{(v_x^2 + v_y^2)(a_x^2 + a_y^2)}{a_x^2 + a_y^2} = $$ $$ (a_x^2 + a_y^2) \left[ t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right]^2 + \frac{(v_x^2+v_y^2)(a_x^2+a_y^2) - (a_x v_x + a_y v_y)^2}{a_x^2 + a_y^2} = $$ $$ (a_x^2 + a_y^2) \left[ t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right]^2 $$ $$ + \frac{v_x^2 a_x^2 + v_x^2 a_y^2 + v_y^2 a_x^2 + v_y^2 a_y^2 - a_x^2 v_x^2 - 2 a_x v_x a_y v_y - a_y^2 v_y^2}{a_x^2 + a_y^2} = $$ $$ (a_x^2 + a_y^2) \left[ t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right]^2 + \frac{v_x^2 a_y^2 -2 v_x a_y v_y a_x + v_y^2 a_x^2}{a_x^2 + a_y^2} = $$ $$ (a_x^2 + a_y^2) \left[ t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right]^2 + \frac{(v_x a_y - v_y a_x)^2}{a_x^2 + a_y^2} $$ Resulting in: $$ L = \int_{t_1}^{t_2} \sqrt{ (a_x^2 + a_y^2) \left[ t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right]^2 + \frac{(v_x a_y - v_y a_x)^2}{a_x^2 + a_y^2} } \; \; dt $$ Now put: $$ u = t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \hieruit du = dt $$ Then: $$ L = \int_{u_1}^{u_2} \sqrt{ (a_x^2 + a_y^2) \: u^2 + \frac{(v_x a_y - v_y a_x)^2}{a_x^2 + a_y^2} } \; \; du = $$ $$ + \; \frac{v_x a_y - v_y a_x}{\sqrt{a_x^2 + a_y^2}} \int_{u_1}^{u_2} \sqrt{ 1 + \left[ \frac{(a_x^2 + a_y^2) \: u}{v_x a_y - v_y a_x} \right]^2 } \; \; du $$ Now put: $$ w = \frac{a_x^2 + a_y^2}{v_x a_y - v_y a_x} \: u \hieruit du = \frac{v_x a_y - v_y a_x}{a_x^2 + a_y^2} \: dw $$ Then $w$ is a dimensionless quantity. And: $$ L = \frac{(v_x a_y - v_y a_x)^2}{(a_x^2 + a_y^2)^{3/2}} \int_{w_1}^{w_2} \sqrt{1+w^2} \; dw $$ Where: $$ \int \sqrt{1+w^2} \; dw = $$ $$ w\sqrt{1+w^2} - \int w \; d\sqrt{1+w^2} = w\sqrt{1+w^2} - \int \frac{w.w}{\sqrt{1+w^2}} \; dw = $$ $$ w\sqrt{1+w^2} - \int \frac{1+w^2}{\sqrt{1+w^2}} \; dw + \int \frac{dw}{\sqrt{1+w^2}} = $$ $$ w\sqrt{1+w^2} - \int \sqrt{1+w^2} \; dw + \int \frac{dw}{\sqrt{1+w^2}} $$ $$ \hieruit 2 \int \sqrt{1+w^2} \; dw = w\sqrt{1+w^2} + \int \frac{dw}{\sqrt{1+w^2}} = $$ $$ w\sqrt{1+w^2} \; + \; \ln(w + \sqrt{1+w^2}) $$ $$ \hieruit \int \sqrt{1+w^2} \; dw = \half w\sqrt{1+w^2} + \half \ln(w + \sqrt{1+w^2}) $$ Summarizing: $$ L = \frac{(v_x a_y - v_y a_x)^2}{(a_x^2 + a_y^2)^{3/2}} \left[ \half w\sqrt{1+w^2} + \half \ln(w + \sqrt{1+w^2}) \right]_{w_1}^{w_2} $$ Where: $$ w = \frac{a_x^2 + a_y^2}{v_x a_y - v_y a_x} \left( t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right) $$ There exist two degenerate cases, where division by zero eventually can occur. $$ \vec{a} = (a_x,a_y) = 0 \hieruit L = \int_{t_1}^{t_2} \sqrt{v_x^2 + v_y^2} \; dt = \sqrt{v_x^2 + v_y^2} \; (t_2 - t_1) $$ And: $$ v_x a_y - v_y a_x = 0 \hieruit v_x / v_y = a_x / a_y \qquad \mbox{: acceleration and velocity paralllel} $$ Giving: $$ L = \int_{t_1}^{t_2} \sqrt{ (a_x^2 + a_y^2) \left( t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right)^2 } \; \; dt = \sqrt{a_x^2 + a_y^2} \int_{t_1}^{t_2} \left( t + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} \right) \; dt $$ $$ \hieruit L = \sqrt{a_x^2 + a_y^2} \left[ \half t^2 + \frac{a_x v_x + a_y v_y}{a_x^2 + a_y^2} t \right]_{t_1}^{t_2} $$