<iframe src="https://www.jsxgraph.org/share/iframe/rolling-reuleaux-pentagon" style="border: 1px solid black; overflow: hidden; width: 550px; aspect-ratio: 55 / 65;" name="JSXGraph example: Rolling Reuleaux pentagon" allowfullscreen ></iframe>
<input type="button" value="start" onclick="rol5.start();rol3.start();"> <input type="button" value="stop" onclick="rol5.stop();rol3.stop();"> <input type="button" value="one step" onclick="rol5.rolling();rol3.rolling();"> <div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; "> <div id="board-0" class="jxgbox" style="aspect-ratio: 1 / 1; width: 100%;" data-ar="1 / 1"></div> </div> <script type = "text/javascript"> /* This example is licensed under a Creative Commons Attribution ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/ Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits. */ const BOARDID = 'board-0'; var board = JXG.JSXGraph.initBoard(BOARDID, { boundingbox: [-2, 7, 20, -3], keepaspectratio: true }); board.renderer.container.style.backgroundColor = '#3d1c24'; // background color board board.suspendUpdate(); // Pentagon var A = board.create('point', [-2, -2]); var B = board.create('point', [0, 0]); var pol5 = board.create('regularpolygon', [A, B, 5], { withLines: false, fillColor: 'none', highlightFillColor: 'none', fillOpacity: 0.0 }); for (var i = 0; i < 5; i++) pol5.vertices[i].setAttribute({ color: '#3d1c24' }); // Triangle var C = board.create('point', [-2, -2]); var D = board.create('point', [C.X() + 3 / 5 * (1 + Math.sqrt(5)) * 0.5 * A.Dist(B), C.Y()]); var pol3 = board.create('regularpolygon', [C, D, 3], { withLines: false, fillColor: 'none', highlightFillColor: 'none', fillOpacity: 0.0 }); for (i = 0; i < 3; i++) pol3.vertices[i].setAttribute({ color: '#3d1c24' }); var line = board.create('curve', [function(t) { return t; }, function(t) { return -2; }], { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#d6bb55', highlightFillColor: '#d6bb55' }); var reuleauxPentagon = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol5.vertices, 5), { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#ad5544', highlightFillColor: '#ad5544' }); var reuleauxTriangle = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol3.vertices, 3), { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#703545', highlightFillColor: '#703545' }); board.unsuspendUpdate(); var rol5 = board.createRoulette(line, reuleauxPentagon, -2, Math.PI / 45, 1, 100, [A, B, C, D]); var rol3 = board.createRoulette(reuleauxPentagon, reuleauxTriangle, 6 * Math.PI / 5, Math.PI / 45, -1, 40, [C, D]); </script>
/* This example is licensed under a Creative Commons Attribution ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/ Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits. */ const BOARDID = 'your_div_id'; // Insert your id here! var board = JXG.JSXGraph.initBoard(BOARDID, { boundingbox: [-2, 7, 20, -3], keepaspectratio: true }); board.renderer.container.style.backgroundColor = '#3d1c24'; // background color board board.suspendUpdate(); // Pentagon var A = board.create('point', [-2, -2]); var B = board.create('point', [0, 0]); var pol5 = board.create('regularpolygon', [A, B, 5], { withLines: false, fillColor: 'none', highlightFillColor: 'none', fillOpacity: 0.0 }); for (var i = 0; i < 5; i++) pol5.vertices[i].setAttribute({ color: '#3d1c24' }); // Triangle var C = board.create('point', [-2, -2]); var D = board.create('point', [C.X() + 3 / 5 * (1 + Math.sqrt(5)) * 0.5 * A.Dist(B), C.Y()]); var pol3 = board.create('regularpolygon', [C, D, 3], { withLines: false, fillColor: 'none', highlightFillColor: 'none', fillOpacity: 0.0 }); for (i = 0; i < 3; i++) pol3.vertices[i].setAttribute({ color: '#3d1c24' }); var line = board.create('curve', [function(t) { return t; }, function(t) { return -2; }], { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#d6bb55', highlightFillColor: '#d6bb55' }); var reuleauxPentagon = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol5.vertices, 5), { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#ad5544', highlightFillColor: '#ad5544' }); var reuleauxTriangle = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol3.vertices, 3), { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#703545', highlightFillColor: '#703545' }); board.unsuspendUpdate(); var rol5 = board.createRoulette(line, reuleauxPentagon, -2, Math.PI / 45, 1, 100, [A, B, C, D]); var rol3 = board.createRoulette(reuleauxPentagon, reuleauxTriangle, 6 * Math.PI / 5, Math.PI / 45, -1, 40, [C, D]);
<input type="button" value="start" onclick="rol5.start();rol3.start();"> <input type="button" value="stop" onclick="rol5.stop();rol3.stop();"> <input type="button" value="one step" onclick="rol5.rolling();rol3.rolling();">
// Define the id of your board in BOARDID var board = JXG.JSXGraph.initBoard(BOARDID, { boundingbox: [-2, 7, 20, -3], keepaspectratio: true }); board.renderer.container.style.backgroundColor = '#3d1c24'; // background color board board.suspendUpdate(); // Pentagon var A = board.create('point', [-2, -2]); var B = board.create('point', [0, 0]); var pol5 = board.create('regularpolygon', [A, B, 5], { withLines: false, fillColor: 'none', highlightFillColor: 'none', fillOpacity: 0.0 }); for (var i = 0; i < 5; i++) pol5.vertices[i].setAttribute({ color: '#3d1c24' }); // Triangle var C = board.create('point', [-2, -2]); var D = board.create('point', [C.X() + 3 / 5 * (1 + Math.sqrt(5)) * 0.5 * A.Dist(B), C.Y()]); var pol3 = board.create('regularpolygon', [C, D, 3], { withLines: false, fillColor: 'none', highlightFillColor: 'none', fillOpacity: 0.0 }); for (i = 0; i < 3; i++) pol3.vertices[i].setAttribute({ color: '#3d1c24' }); var line = board.create('curve', [function(t) { return t; }, function(t) { return -2; }], { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#d6bb55', highlightFillColor: '#d6bb55' }); var reuleauxPentagon = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol5.vertices, 5), { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#ad5544', highlightFillColor: '#ad5544' }); var reuleauxTriangle = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol3.vertices, 3), { strokeWidth: 6, strokeColor: '#d66d55', fillColor: '#703545', highlightFillColor: '#703545' }); board.unsuspendUpdate(); var rol5 = board.createRoulette(line, reuleauxPentagon, -2, Math.PI / 45, 1, 100, [A, B, C, D]); var rol3 = board.createRoulette(reuleauxPentagon, reuleauxTriangle, 6 * Math.PI / 5, Math.PI / 45, -1, 40, [C, D]);
This example is licensed under a Creative Commons Attribution ShareAlike 4.0 International License. Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits.