Although the polynomial curves are the easiest tool for curve design, they lack flexibility (for instance, they have as many roots as its degree). Let us see, as an example, how a cubic approximates five points over a sinusoidal curve:
The lack of flexibility of the polynomials can cause, as well, the existence of parts of the curve with a high degree of curvature or undesirable and rough oscillations:
On the other hand, the amount of curves that can be described in an precise way by polynomial parametrizations is quite limited. The result of approximating a circle by pieces of parabolas is, at least, unsatisfactory:
An alternative possibility, that we will consider in the next chapter, is working with piecewise polynomial curves and functions. Another possibility is using rational curves.
We shall define the rational parametrizations of degree n as those whose components are polynomial curves of degree n.
Let (c0(t),c1(t),c2(t)), t∊[0,1] be a polynomial curve in R3 such that does not pass through the origin. We know that its projection onto the affine plane is a parametrization (c1(t)/c0(t),c2(t)/c0(t)).
We shall split the coordinates of the vertices in two parts: ci = (wi,wici), where wi is the first component of the i-th vertex, and wici are the two remaining components (three, if we are working with a spatial curve). ci is just the projection of ci over the affine plane.
In this case, we are describing the rational curves via a control polygon {c0,...,cn} and some parameters, {wi,...,wn}, that we shall call weights.
|
If all the wieghts have the same value, w = wi, i = 0,...,n, then we recover the polynomial curve,
|
of control polygon {c0,...,cn}.
If we want to continue working with positive expressions, we need to use positive values for the weights as well. In design it is usual working with weight values around one. Here is an example of a curve with some negative weights.
The interpretation of the weights is this: The larger the weight wk is (leaving unchanged the rest of weights), the closer the curve approaches the corresponding vertex ck . Example
This fact can be used to increase the "tension" of the curve. Example
If we multiply all the weights by the same factor, the curve remains the same. Example
This well known fact can be used for normalizing the weights by taking the first weight equal to one.
What if one of the vertices ci is a point at infinity?
In this case, there is no sense in talking about the weight wi, because the first component of the vertex is equal to zero, ci = (0,ci). Its image is an affine vector, not a point, and therefore, we shall call it control vector. Hence, making this distinction, the expression of a rational curve is:
|
The presence of control vectors is quite disturbing because, the expression (2) is no longer a barycentric combination of points, and, consequently, the property of convex hull will be no longer true. Example
Many of the properties of Bézier curves can be straightaway translated to rational ones, because we are still using barycentric combinations of the control polygon vertices.
The following properties, derived from this fact, remain the same: the convex hull property, the variation diminishing property and the invariance under affine maps. Example
Other properties, as passing through the first and the last vertices c0, cn or being symmetric, remain the same as well.
|
The rational curves are invariant under projective maps. Let f be a projective map of the plane and {c0,...,cn}, {w0,...,wn} the control polygon and the list of weights of a rational parametrization. Consequently:
|
where the vertices and weights ci = (wi,wici) of the transformed curve are related to those of the original curve ci = (wi,wici) by the relation: c'i = f(ci) = (w'i,w'ic'i).
This maps are particular useful because they include the change of perspective. Example
A projective map of the real line transforms a rational parametrization of degree n c(t) into another of the same degree c'(u) = c(t(u)),
|
We shall reparametrize making keeping the final interval equal to [0,1]. This can be done with transformations of this form:
|
and this is impossible with affine maps.
These transformations cause the changes of the weights: {w'0,...,w'n}, w'i = bn-iwi. But the control polygon remains the same, {c0,...,cn}.
There are infinite lists of weights that give us the same rational curve. The graphic of the curve is the same, but the velocity of the parametrization is different.
If b < 1, we travel along the curve faster at the beginning than at the end. When we reach u = 1/2, we are beyond t = 1/2 in the original parametrization. And the contrary happens when b > 1. Example In the following graphic we can see t(u) for b=1/2, green and b=2, red.
We can freely choose the value of b in order to fix a value for a particular weight. If we choose b = (wn/w0)1/n, then w'0 = wn = w'n.
Usually the initial and final weights are chosen in a way that w0 = 1 = wn.
Rational parametrizations describe arcs of any sort of conic sections.
Assume w0 = 1 = w2, w1 = w (a normalized parametrization), on a rational curve of degree two,
|
Considering only positive values of the weights, for 0 < w < 1 we shall get an arch of ellipse. For w = 1, we have an arc of parabola, and for w > 1, we have a hyperbola. Example
With a simple geometrical construction, we can find the vertices of the control polygon of an arc of circumference.
In the figure, if we put the centre in (0,0) and the endpoints c0, c2 in (-Rsinα,Rcosα), (Rsinα,Rcosα), respectively, the vertex c1 will be (0,R/cosα).
The value of the weight is w = cosα. For example, in order to trace a quarter of a circumference, the weight takes the value 21/2/2 and for and arch of 2π/3, takes 1/2.
For half a circumference, we can trace it if we use control vectors, Example
|
If we multiply both numerator and denominator by the same function f(t), the parametrization is invariant, but both expressions change notably. As our purpose is increasing the degree in one, we choose a function of degree one,
|
Using this expression, we have countless ways of increasing in one degree the parametrization's degree. It depends on the value of the parameters α,β. It is reasonable to choose them both positive in order to avoid negative terms. Example
If we take α = 1 = β, we get the degree elevation formula derived in the previous chapter (Chapter 2).
Degree elevation (5) and (4) are not commutative. This means that if we first increase the degree of the curve and then reparametrize, we shall not get the same result as if we first reparametrize and then increase the degree of the curve, as it can be seen in the following figure:
The de Casteljau Algorithm can be generalized to rational curves:
|
where, obviously, w0)i = wi, c0)i = ci.
For a given control polygon {c0,... ,cn}, and a list of weights, {w0,... ,wn},
|
the expression of the derivatives of a product give us the derivative of the rational parametrization,
|
|
These expressions are very intricate, because they involve lower derivatives in both numerator and denominator.
Due to the formulae for the derivatives of the polynomial parametrizations,
|
regarding the first derivative there is only one new thing, the weights of the first and the last point. Example
Let {c0,... ,cn}, {c'0,... ,c'n} and {w0,... ,wn}, {w'0,...,w'n} be the control polygons and list of weights of two rational curves defined over the intervals [u0,u1] and [u1,u2] respectively. The condition for forming a continuous curve is:
|
This is the same condition studied for Bézier curves.
As cn, c'0 are the same point, it seems reasonable to impose wn = w'0.
Besides, if we want the parametrization to be C1 class,
|
From the second derivative on, things get more complicated. If we want the rational parametrization to be Cr class, we can impose a sufficient condition, but not necessary, in order to achieve our goal:
|
Rational curves add many degrees of freedom to those of Bézier curves, and we shall use them in order to solve more complex problems of interpolation and approximation.
We could see the rational problem as a polynomial problem in R3 where the given data are the values c(ti) = ai, i = 0,...,m, for ai = (vi,viai). As the given data of the problem are: c(ti) = ai, consequently, the weights of the given points vi, i = 0,...,m remain as free parameters.
There are no general algorithms to determine those weights. Thus we are to consider them as degrees of freedom that will allow us to improve the resulting curve. Example