Reuleaux pentagon

From JSXGraph Wiki
Revision as of 20:45, 2 October 2010 by A WASSERMANN (talk | contribs)

The underlying JavaScript code

var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5]});
brd.suspendUpdate();
// Pentagon
var A = brd.create('point',[-2,-2]);
var B = brd.create('point',[2,-2]);
var pol = brd.create('regularpolygon',[A,B,5], {withLines:false, fillColor:'none', highlightFillColor:'none'});
var reuleauxPentagon = brd.create('curve', JXG.Math.Numerics.reuleauxPolygon(pol.vertices, 5), 
       {color:'#093083', highlightFillColor:'#093083'});
       
// Triangle
var C = brd.create('point',[-2,-2]);
var D = brd.create('point',[C.X()+3/5*(1+Math.sqrt(5))*0.5*A.Dist(B), C.Y()]);
var pol3 = brd.create('regularpolygon',[C,D,3], {withLines:false, fillColor:'#e8501f', highlightFillColor:'#e8501f'});
var reuleauxTriangle = brd.create('curve', JXG.Math.Numerics.reuleauxPolygon(pol3.vertices, 3), 
       {color:'#e8501f', highlightFillColor:'#e8501f'});

brd.unsuspendUpdate();
var rol = JXG.Math.Numerics.createRoulette(reuleauxPentagon, reuleauxTriangle, 6*Math.PI/5, Math.PI/90, -1, 10, [C,D]);