Bezier curves II: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) (New page: The red points are connected by a cubic Bezier curve. The blue points are the control points. <jsxgraph width="600" height="600"> var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-4...) |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-4,4,4,-4],keepaspectratio:true,axis:true}); | var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-4,4,4,-4],keepaspectratio:true,axis:true}); | ||
var p = []; | var p = [] l = []; | ||
col = 'red'; | col = 'red'; | ||
Line 13: | Line 13: | ||
col = 'red'; | col = 'red'; | ||
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})); | |||
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:13, 28 September 2009
The red points are connected by a cubic Bezier curve. The blue points are the control points.