<iframe src="http://jsxgraph.org/share/iframe/curly-brackets" style="border: 1px solid black; overflow: hidden; width: 550px; aspect-ratio: 55 / 65;" name="JSXGraph example: Curly brackets" allowfullscreen ></iframe>
<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 4.0 International License. https://creativecommons.org/licenses/by/4.0/ Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits. */ const BOARDID = 'board-0'; const board = JXG.JSXGraph.initBoard(BOARDID, {boundingbox:[-4,4,4,-4], keepaspectratio:true, axis:true}); var A = board.create('point', [-3,3]); var B = board.create('point', [3,-2]); var line = board.create('segment', [A,B]); var height = 0.5; // height of the curly bracket // Build the curly bracket var crl = board.create('curve', [[0],[0]], {strokeWidth:1, strokeColor:'black'}); crl.bezierDegree = 3; crl.updateDataArray = function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = [(A.X() + B.X()) * 0.5, (A.Y() + B.Y()) * 0.5]; d[0] *= height / dl; d[1] *= height / dl; this.dataX = [ A.X(), A.X() - d[1], mid[0], mid[0] - d[1], mid[0], B.X() - d[1], B.X() ]; this.dataY = [ A.Y(), A.Y() + d[0], mid[1], mid[1] + d[0], mid[1], B.Y() + d[0], B.Y() ]; }; // Text var txt = board.create('text', [ function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.X() + B.X()) * 0.5; d[1] *= height / dl; return mid - d[1] + 0.1; }, function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.Y() + B.Y()) * 0.5; d[0] *= height / dl; return mid + d[0] + 0.1; }, () => 'length=' + B.Dist(A).toFixed(2) ]); board.update(); // This update is necessary to call updateDataArray the first time. </script>
/* This example is licensed under a Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/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! const board = JXG.JSXGraph.initBoard(BOARDID, {boundingbox:[-4,4,4,-4], keepaspectratio:true, axis:true}); var A = board.create('point', [-3,3]); var B = board.create('point', [3,-2]); var line = board.create('segment', [A,B]); var height = 0.5; // height of the curly bracket // Build the curly bracket var crl = board.create('curve', [[0],[0]], {strokeWidth:1, strokeColor:'black'}); crl.bezierDegree = 3; crl.updateDataArray = function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = [(A.X() + B.X()) * 0.5, (A.Y() + B.Y()) * 0.5]; d[0] *= height / dl; d[1] *= height / dl; this.dataX = [ A.X(), A.X() - d[1], mid[0], mid[0] - d[1], mid[0], B.X() - d[1], B.X() ]; this.dataY = [ A.Y(), A.Y() + d[0], mid[1], mid[1] + d[0], mid[1], B.Y() + d[0], B.Y() ]; }; // Text var txt = board.create('text', [ function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.X() + B.X()) * 0.5; d[1] *= height / dl; return mid - d[1] + 0.1; }, function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.Y() + B.Y()) * 0.5; d[0] *= height / dl; return mid + d[0] + 0.1; }, () => 'length=' + B.Dist(A).toFixed(2) ]); board.update(); // This update is necessary to call updateDataArray the first time.
<jsxgraph width="100%" aspect-ratio="1 / 1" title="Curly brackets" description="This construction was copied from JSXGraph examples database: BTW HERE SHOULD BE A GENERATED LINKuseGlobalJS="false"> /* This example is licensed under a Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/ Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits. */ const board = JXG.JSXGraph.initBoard(BOARDID, {boundingbox:[-4,4,4,-4], keepaspectratio:true, axis:true}); var A = board.create('point', [-3,3]); var B = board.create('point', [3,-2]); var line = board.create('segment', [A,B]); var height = 0.5; // height of the curly bracket // Build the curly bracket var crl = board.create('curve', [[0],[0]], {strokeWidth:1, strokeColor:'black'}); crl.bezierDegree = 3; crl.updateDataArray = function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = [(A.X() + B.X()) * 0.5, (A.Y() + B.Y()) * 0.5]; d[0] *= height / dl; d[1] *= height / dl; this.dataX = [ A.X(), A.X() - d[1], mid[0], mid[0] - d[1], mid[0], B.X() - d[1], B.X() ]; this.dataY = [ A.Y(), A.Y() + d[0], mid[1], mid[1] + d[0], mid[1], B.Y() + d[0], B.Y() ]; }; // Text var txt = board.create('text', [ function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.X() + B.X()) * 0.5; d[1] *= height / dl; return mid - d[1] + 0.1; }, function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.Y() + B.Y()) * 0.5; d[0] *= height / dl; return mid + d[0] + 0.1; }, () => 'length=' + B.Dist(A).toFixed(2) ]); board.update(); // This update is necessary to call updateDataArray the first time. </jsxgraph>
// Define the id of your board in BOARDID const board = JXG.JSXGraph.initBoard(BOARDID, {boundingbox:[-4,4,4,-4], keepaspectratio:true, axis:true}); var A = board.create('point', [-3,3]); var B = board.create('point', [3,-2]); var line = board.create('segment', [A,B]); var height = 0.5; // height of the curly bracket // Build the curly bracket var crl = board.create('curve', [[0],[0]], {strokeWidth:1, strokeColor:'black'}); crl.bezierDegree = 3; crl.updateDataArray = function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = [(A.X() + B.X()) * 0.5, (A.Y() + B.Y()) * 0.5]; d[0] *= height / dl; d[1] *= height / dl; this.dataX = [ A.X(), A.X() - d[1], mid[0], mid[0] - d[1], mid[0], B.X() - d[1], B.X() ]; this.dataY = [ A.Y(), A.Y() + d[0], mid[1], mid[1] + d[0], mid[1], B.Y() + d[0], B.Y() ]; }; // Text var txt = board.create('text', [ function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.X() + B.X()) * 0.5; d[1] *= height / dl; return mid - d[1] + 0.1; }, function() { var d = [B.X() - A.X(), B.Y() - A.Y()], dl = Math.sqrt(d[0] * d[0] + d[1] * d[1]), mid = (A.Y() + B.Y()) * 0.5; d[0] *= height / dl; return mid + d[0] + 0.1; }, () => 'length=' + B.Dist(A).toFixed(2) ]); board.update(); // This update is necessary to call updateDataArray the first time.
This example is licensed under a Creative Commons Attribution 4.0 International License. Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits.