Rolling circle on circle: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
<form> | <form> | ||
<input type="button" value="start" onclick="rol.start()"> | <input type="button" value="start" onclick="rol.start()"> | ||
Line 11: | Line 9: | ||
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5], keepaspectratio:true}); | var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5], keepaspectratio:true}); | ||
brd.suspendUpdate(); | brd.suspendUpdate(); | ||
// Big circle | // Big circle | ||
var bigCircle = brd.create('curve', [ | var bigCircle = brd.create('curve', [ | ||
Line 20: | Line 17: | ||
var C = brd.create('point',[2,0],{name:'C'}); | var C = brd.create('point',[2,0],{name:'C'}); | ||
var circle = brd.create('curve',[ | var circle = brd.create('curve',[ | ||
function(t){var d = P.Dist(C); | function(t){var d = P.Dist(C), | ||
beta = JXG.Math.Geometry.rad([C.X()+1,C.Y()],C,P); | |||
t += beta; | |||
return C.X()+d*Math.cos(t); | return C.X()+d*Math.cos(t); | ||
}, | }, | ||
function(t){var d = P.Dist(C); | function(t){var d = P.Dist(C), | ||
beta = JXG.Math.Geometry.rad([C.X()+1,C.Y()],C,P); | |||
t += beta; | |||
return C.Y()+d*Math.sin(t); | return C.Y()+d*Math.sin(t); | ||
}, | }, | ||
Line 30: | Line 31: | ||
// Point on circle | // Point on circle | ||
var B = brd.create('glider',[0,2,circle],{name:'B', color:'blue',trace: | var B = brd.create('glider',[0,2,circle],{name:'B', color:'blue',trace:false}); | ||
brd.create('segment',[C,B],{color:'black'}); | brd.create('segment',[C,B],{color:'black'}); | ||
brd.unsuspendUpdate(); | brd.unsuspendUpdate(); | ||
var rol = | var rol = brd.createRoulette(bigCircle, circle, 0, Math.PI/45, -1, 150, [C,P,B]); | ||
</jsxgraph> | </jsxgraph> |
Latest revision as of 17:19, 23 November 2010