Parametric equations are powerful and flexible. Perhaps the most familiar example is the equation of a circle in the form x = r*cos(θ), y = r*sin(θ). In this case, the parameter θ is the independent variable and increases monotonically (i.e. each successive value is larger than the previous one, which is a requirement of parametric equations in general), and x and y are dependent variables. The resulting plot of y vs x can wrap on itself, which a circle indeed does. There are many forms of polynomial parametric equations (e.g. Bezier, B-Spline, NURBS, Catmull-Rom) that have entire books devoted to their understanding and use. In this tutorial, we offer a brief introduction by way of examples to provide a basic understanding of the relative simplicity of parametric equations. Specifically, we will build upon the tools learned in the cubic spline tutorial (http://www.vbforums.com/showthread.php?t=480806) to extend our knowledge to parametric cubic splines.

Recall that a cubic spline is nothing more than a sequence of 3^{rd}order polynomials joined at the endpoints with enforced 1^{st}and 2^{nd}derivative compatibility at interior points and specified end conditions at the free ends. Extending this concept to parametric splines just means formulating two sets of equations instead of one using the exact same methodology as a standard (non parametric) cubic spline. In the case of parametric cubic splines, each spline segment is represented by 2 equations in an independent variable s:

x = f_{1}(s) = a_{x}(s-s_{0})^{3}+ b_{x}(s-s_{0})^{2}+ c_{x}(s-s_{0}) + d_{x}

y = f_{2}(s) = a_{y}(s-s_{0})^{3}+ b_{y}(s-s_{0})^{2}+ c_{y}(s-s_{0}) + d_{y}

where s_{0}represents the value of the independent variable s at the beginning of the segment. Though not required, it is convenient to have s vary from 0 to 1. To get an idea of how powerful these equations are, consider the following simple equations for x & y:

x = 26s^{3}- 40s^{2}+ 15s - 1

y = -4s^{2}+ 3s

The resulting plot of y vs x (for s = 0 to 1) is truly amazing. It almost seems magical that a single cubic polynomial (well, two actually) can generate such a complicated shape. Thats the power of parametric equations.

Example Problem #1 (Connecting Spline Segments)

Lets focus on joining several parametric cubic spline segments to form a shape. Consider the following 4 points x = [(1,0), (0,1), (-1,0), (0,-1)]. There are several ways the points can be connected to form a shape. We wish to connect them in a crossing fashion as illustrated in the picture.

.