tkspline(3tk) [centos man page]

```tkspline(n)				   Tk Spline - An additional smoothing method for canvas items				       tkspline(n)

__________________________________________________________________________________________________________________________________________________

NAME
spline, - additional smoothing method for canvas items.

SYNOPSIS
package require Tkspline
...
.c create line ... -smooth spline ...
.c create polygon ... -smooth spline ...
_________________________________________________________________

INTRODUCTION
The new option value: -smooth spline provides an additional smoothing method to line and polygon canvas items.

Spline smoothing will revert to the builtin smoothing method unless the number of points is 3n+1, where n is the number of spline segments.
(Normally in polygons this means 3n points because the last point of the spline is understood to be the same as the first in order to close
the polygon).

In line and polygon items, the curves generated with the standard -smooth true option have the following properties:

-  the curve is always tangential to a straight line between consecutive points.

-  the curve is only guaranteed to intersect the first and last points of lines.

-  the curve is not guaranteed to intersect any points of polygons.

With -smooth spline (and the right number of coordinates) the curves generated have the following different properties:

-  the curve is guaranteed to intersect the first point, and every third point after that.

-  each segment of the curve shares endpoints with the adjacent segments, but is otherwise independent of them.

-  the curve is guaranteed to be tangential to a line between n and n+1 at point n, and also to a line between n+2 and n+3 at point n+3.

-  the  curve is not guaranteed to be smooth at the junctions between segments unless the shared point and the points either side of it are
on a straight line.

These alternative properties are useful to some path planning algorithms.

CREDITS
The underlying Bezier code is in John Ousterhout's original canvas widget, this extension just provides an alternate interface to it.   The
hooks into the canvas are provided by Jan Nijtmans in his "dash" patch.

KEYWORDS
spline, line, polygon, bezier, canvas, widget

AUTHOR
John Ellson, ellson@graphviz.org

Tk									8.0							       tkspline(n)```

Check Out this Related Man Page

```exspline(3alleg4)						  Allegro manual						 exspline(3alleg4)

NAME
exspline - Constructing smooth movement paths from spline curves. Allegro game programming library.

SYNOPSIS
#include <allegro.h>

Example exspline

DESCRIPTION
This  program  demonstrates the use of spline curves to create smooth paths connecting a number of node points. This can be useful for con-
structing realistic motion and animations.

The technique is to connect the series of guide points p1..p(n) with spline curves from p1-p2, p2-p3, etc. Each	spline	must  pass  though
both of its guide points, so they must be used as the first and fourth of the spline control points. The fun bit is coming up with sensible
values for the second and third spline control points, such that the spline segments will have equal gradients where they meet. I  came	up
with the following solution:

For  each  guide point p(n), calculate the desired tangent to the curve at that point. I took this to be the vector p(n-1) -> p(n+1), which
can easily be calculated with the inverse tangent function, and gives decent looking results. One implication of this  is  that	two  dummy
guide points are needed at each end of the curve, which are used in the tangent calculations but not connected to the set of splines.

Having  got these tangents, it becomes fairly easy to calculate the spline control points. For a spline between guide points p(a) and p(b),
the second control point should lie along the positive tangent from p(a), and the third control point should lie along the negative tangent
from p(b). How far they are placed along these tangents controls the shape of the curve: I found that applying a 'curviness' scaling factor
to the distance between p(a) and p(b) works well.

One thing to note about splines is that the generated points are not all equidistant. Instead they tend to bunch up nearer to the  ends	of
the  spline,  which means you will need to apply some fudges to get an object to move at a constant speed. On the other hand, in situations
where the curve has a noticeable change of direction at each guide point, the effect can be quite nice because it  makes  the  object  slow
down for the curve.