Circular arc approximation by cubic Bezier curve: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 4: Line 4:
var M = brd.create('point', [0,0], {name:'M'});
var M = brd.create('point', [0,0], {name:'M'});
var C = brd.create('point', [0,-1], {name:'D'});
var C = brd.create('point', [0,-1], {name:'D'});
var c = brd.create('circle', [M,C], {strokeWidth:1});
var c = brd.create('circle', [M,1], {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 24: Line 24:
};
};
var P1 = brd.create('point', [
var P1 = brd.create('point', [
             function(){ return M.X()+A.X()-k(M,A,B)*(A.Y()); },
             function(){ return M.X()+A.X()-k(M,A,B)*(A.Y()-M.Y()); },
             function(){ return M.Y()+A.Y()+k(M,A,B)*(A.X()); }
             function(){ return M.Y()+A.Y()+k(M,A,B)*(A.X()-M.X()); }
], {});
], {});
var P2 = brd.create('point', [
var P2 = brd.create('point', [

Revision as of 12:34, 1 July 2012

The underlying JavaScript code