JSXGraph logo
JSXGraph
JSXGraph share

Share

Rolling Reuleaux triangle
QR code
<iframe 
    src="http://jsxgraph.uni-bayreuth.de/share/iframe/rolling-reuleaux-triangle" 
    style="border: 1px solid black; overflow: hidden; width: 550px; aspect-ratio: 55 / 65;" 
    name="JSXGraph example: Rolling Reuleaux triangle" 
    allowfullscreen
></iframe>
This code has to
<input type="button" value="start" onclick="rol3.start();">
<input type="button" value="stop" onclick="rol3.stop();">
<input type="button" value="one step" onclick="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();
    // Triangle
    var A = board.create('point', [-2, -2]);
    var B = board.create('point', [0, 0]);
    var pol3 = board.create('regularpolygon', [A, B, 3], { withLines: false, fillColor: 'none', highlightFillColor: 'none',
        fillOpacity: 0.0 });
    for (var 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 reuleauxTriangle = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol3.vertices, 3), { strokeWidth: 6,
        strokeColor: '#d66d55', fillColor: '#ad5544', highlightFillColor: '#ad5544' });
    var S = board.create('point', [
                function() { return (pol3.vertices[0].X() + pol3.vertices[1].X() + pol3.vertices[2].X()) / 3; },
                function() { return (pol3.vertices[0].Y() + pol3.vertices[1].Y() + pol3.vertices[2].Y()) / 3; }
        ], { strokeColor: '#703545', fillColor: '#703545', highlightFillColor: '#703545', name: 'S', trace: true });
    
    board.unsuspendUpdate();
    var rol3 = board.createRoulette(line, reuleauxTriangle, -2, Math.PI / 45, 1, 100, [A, B]);
 </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();
// Triangle
var A = board.create('point', [-2, -2]);
var B = board.create('point', [0, 0]);
var pol3 = board.create('regularpolygon', [A, B, 3], { withLines: false, fillColor: 'none', highlightFillColor: 'none',
    fillOpacity: 0.0 });
for (var 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 reuleauxTriangle = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol3.vertices, 3), { strokeWidth: 6,
    strokeColor: '#d66d55', fillColor: '#ad5544', highlightFillColor: '#ad5544' });
var S = board.create('point', [
            function() { return (pol3.vertices[0].X() + pol3.vertices[1].X() + pol3.vertices[2].X()) / 3; },
            function() { return (pol3.vertices[0].Y() + pol3.vertices[1].Y() + pol3.vertices[2].Y()) / 3; }
    ], { strokeColor: '#703545', fillColor: '#703545', highlightFillColor: '#703545', name: 'S', trace: true });

board.unsuspendUpdate();
var rol3 = board.createRoulette(line, reuleauxTriangle, -2, Math.PI / 45, 1, 100, [A, B]);

Rolling Reuleaux triangle

<input type="button" value="start" onclick="rol3.start();">
<input type="button" value="stop" onclick="rol3.stop();">
<input type="button" value="one step" onclick="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();
// Triangle
var A = board.create('point', [-2, -2]);
var B = board.create('point', [0, 0]);
var pol3 = board.create('regularpolygon', [A, B, 3], { withLines: false, fillColor: 'none', highlightFillColor: 'none',
    fillOpacity: 0.0 });
for (var 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 reuleauxTriangle = board.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol3.vertices, 3), { strokeWidth: 6,
    strokeColor: '#d66d55', fillColor: '#ad5544', highlightFillColor: '#ad5544' });
var S = board.create('point', [
            function() { return (pol3.vertices[0].X() + pol3.vertices[1].X() + pol3.vertices[2].X()) / 3; },
            function() { return (pol3.vertices[0].Y() + pol3.vertices[1].Y() + pol3.vertices[2].Y()) / 3; }
    ], { strokeColor: '#703545', fillColor: '#703545', highlightFillColor: '#703545', name: 'S', trace: true });

board.unsuspendUpdate();
var rol3 = board.createRoulette(line, reuleauxTriangle, -2, Math.PI / 45, 1, 100, [A, B]);

license

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.