saltire family of websites buy a classpad now! download eActivities

Home
ClassPad News
Overview
Online Store
Books
Explorations
Canyon's Corner
Downloads
Links
My Account
Contact
Saltire Family of Websites
Cubic Spline on the Casio ClassPad

The cubic spline  is a curve which is frequently used in computer aided design.  It is useful because the location of the endpoints of the curve and the tangent to the curve at the endpoint may both be specified. 

The spline curve is frequently defined in terms of four control points.  These four points form a quadrilateral which prescribes the shape of the curve.  DeCastlejeau’s construction defines the curve in terms of these four points, and can be modeled in ClassPad using the Animation features:

First let’s create the four control points along with the lines connecting them.  Using the grid is an easy way to make these integers - a fact that will help some later calculations fit more easily on the page!

We now create two more line segments EF and FG, with E lying on AB and F lying on BC and G lying on CD:

Finally we create another segment HI with H on EF and I on CD.  Then we create a point J lying on the new segment.

We now need to create a long list of animations:
  • Animate E along AB
  • Animate F along BC
  • Animate G along CD
  • Animate H along EF
  • Animate I along FG
  • Animate J along HI Finally create a trace at J

    The resulting curve is the cubic spline whose control points are A,B,C,D

    Try changing the control points and notice the relationship between the shape of the curve and the shape of the control quadrilateral:

  • So much for the pictures, what about the equation of the curve?

    Each animation is defined by running a point along a line segment, from its beginning to its end.  If a is the first end point of the segment and b is the second end point, then we can express the location of the animation point at time t as a*(1-t) + b*t.  Let’s use this equation to derive the equation for the spline curve of the third example above:

    First, we drag and drop point A into a Calculation Row in the eActivity window.  We then store this vector in the variable a.

      

    Likewise we can drag and drop point B and C and store them in variables b and c.

    Now, we can define e in terms of a and b

    Notice that when using the single letter variables  (the bold letters found on the VAR tab of the keyboard), you do not need to insert a product symbol (for example between the t and the b in the above expression).

    A similar expression can be created for f . The expand() function can be used to simplify the resulting vector.

     

    We can continue in this vein to create expressions for the rest of the defined points.  As one would expect, they get more complicated as the outputs from previous computations become the inputs to current computations:

      

    J is the point which we traced, so this is the parametric equation for J.

    Let’s use the graphing module to plot it:

    First we insert a Graph Editor into eActivity, and set it up for a parametric plot :

          

    Now we can drag and drop the x and y from our vector into the graph expression editor (remembering to press ENTER to activate the expression).

          

    Pressing the graph button displays the plot.

     

    We observe that this does indeed resemble the curve traced by our animation, but it goes on a bit too long.  Pressing the View Window  button brings up the View Window dialog which enables us to examine the range of t. 

       

     We should set this to run from 0 to 1