Catmull-Rom splines

From JSXGraph Wiki
Revision as of 11:04, 26 January 2012 by A WASSERMANN (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The underlying JavaScript code

var brd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-5, 5, 5, -5]}),
    p = [], c, i;

for (i=0;i<5;i++) {
    p.push(brd.create('point', [(Math.random()-0.5)*7,(Math.random()-0.5)*7],{withLabel:true}));
}
c = brd.create('curve', JXG.Math.Numerics.CatmullRomSpline(p), {strokeWidth:3});