Bezier curves II: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 14: Line 14:
p.push(brd.createElement('point',[-3,1],{strokeColor:col,fillColor:col}));      // data point
p.push(brd.createElement('point',[-3,1],{strokeColor:col,fillColor:col}));      // data point


l.push(brd.createElement('segment',[p[0],p[1]]{strokeOpacity:0.5}));
l.push(brd.createElement('segment',[p[0],p[1]],{strokeOpacity:0.5}));


var c = brd.createElement('curve', JXG.Math.Numerics.bezier(p), {strokecolor:'blue', strokeOpacity:0.6, strokeWidth:5});  
var c = brd.createElement('curve', JXG.Math.Numerics.bezier(p), {strokecolor:'blue', strokeOpacity:0.6, strokeWidth:5});  

Revision as of 11:14, 28 September 2009

The red points are connected by a cubic Bezier curve. The blue points are the control points.

The underlying JavaScript code