Difference between revisions of "Rolling Reuleaux pentagon"

From JSXGraph Wiki
Jump to navigationJump to search
Line 3: Line 3:
 
<script type="text/javascript" src="/~alfred/jsxgraph/trunk/src/Roulette.js"></script>
 
<script type="text/javascript" src="/~alfred/jsxgraph/trunk/src/Roulette.js"></script>
 
<form>
 
<form>
<input type="button" value="start" onclick="start();">
+
<input type="button" value="start" onclick="rol5.start();rol3.start();">
<input type="button" value="stop" onclick="stop();">
+
<input type="button" value="stop" onclick="rol5.stop();rol3.stop();">
 
<input type="button" value="one step" onclick="rol5.rolling();rol3.rolling();">
 
<input type="button" value="one step" onclick="rol5.rolling();rol3.rolling();">
 
</form></html>
 
</form></html>
Line 33: Line 33:
 
brd.unsuspendUpdate();
 
brd.unsuspendUpdate();
  
var rol5 = JXG.Math.Numerics.createRoulette(line, reuleauxPentagon, -2, Math.PI/90, 1, 10, [A,B,C,D]);  
+
var rol5 = JXG.Math.Numerics.createRoulette(line, reuleauxPentagon, -2, Math.PI/90, 1, 50, [A,B,C,D]);  
var rol3 = JXG.Math.Numerics.createRoulette(reuleauxPentagon, reuleauxTriangle, 6*Math.PI/5, Math.PI/90, -1, 10, [C,D]);  
+
var rol3 = JXG.Math.Numerics.createRoulette(reuleauxPentagon, reuleauxTriangle, 6*Math.PI/5, Math.PI/90, -1, 20, [C,D]);  
 
var rollIt = function() {
 
var rollIt = function() {
 
                 rol5.rolling();
 
                 rol5.rolling();
 
                 rol3.rolling();
 
                 rol3.rolling();
 
};
 
};
 +
/*
 
var interval;
 
var interval;
 
var start = function() {
 
var start = function() {
Line 46: Line 47:
 
               clearInterval(interval);
 
               clearInterval(interval);
 
}
 
}
 +
*/
 
</jsxgraph>
 
</jsxgraph>
  

Revision as of 21:31, 3 October 2010

The underlying JavaScript code