Circular arc approximation by cubic Bezier curve: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 3: Line 3:


var M = brd.create('point', [0,0], {name:'M'});
var M = brd.create('point', [0,0], {name:'M'});
var c = brd.create('circle', [M,1], {strokeWidth:1});
var C = brd.create('point', [0,-1], {name:'D'});
var c = brd.create('circle', [M,C], {strokeWidth:1});
var A = brd.create('glider', [1,0,c], {name:'A'});
var A = brd.create('glider', [1,0,c], {name:'A'});
var B = brd.create('glider', [0,1,c], {name:'B'});
var B = brd.create('glider', [0,1,c], {name:'B'});
Line 32: Line 33:


var b = brd.create('curve', JXG.Math.Numerics.bezier([A,P1,P2,B]),  
var b = brd.create('curve', JXG.Math.Numerics.bezier([A,P1,P2,B]),  
               {strokecolor:'blue', strokeOpacity:0.6, strokeWidth:3});  
               {strokecolor:'black', strokeOpacity:0.6, strokeWidth:1});  





Revision as of 12:29, 1 July 2012

The underlying JavaScript code