JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]/distrib/jsxgraphcore.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/distrib/jsxgraph.css">
<div id='jxgbox' class='jxgbox jxgnew'></div>
CSS
div.jxgnew {
aspect-ratio: 1/1;
max-width: 500px;
margin: 0 auto;
overflow:hidden;
}
JavaScript
const board = JXG.JSXGraph.initBoard('jxgbox', {
boundingbox: [-5, 5, 5, -5], axis:true
});
var s = board.create('slider', [[1,4], [3,4], [0, Math.PI/4, 2*Math.PI]]);
var A = board.create('point', [3, 0], {fixed: false});
var B = board.create('point', [0, 0]);
var C = board.create('point', [2, 2], {fixed: false});
var angle = board.create('angle', [A, B, C], {radius: 'auto'});
angle.setAngle(()=>s.Value());