jsxgraph

Loop within STACK question in moodle using jsxgraph

旧巷老猫 提交于 2021-02-11 12:36:28
问题 I am trying to create a moodle-STACK question with an interactive element via jsxgraph . Within the [[jsxgraph]] ... [[/jsxgraph]] tags, I am plotting a curve with two databases, each with 6 elements. Since I would like students to add error bars for both scales, I added a loop within the jsxgraph-element : var plot = function() { var j, xr0, yr0, xr1, yr1, xr2, yr2, err1, err2; board.suspendUpdate(); for (j=0; j<6;j++) { const v1 = Number(input1.Value()); const v2 = Number(input2.Value());

How to access value of integral with JSXGraph?

懵懂的女人 提交于 2020-12-15 05:19:51
问题 I was reading: how to make a dynamic function to draw integral Graph from user input with JSXGraph? There the value of the integral is "-1.6667". How to access the value? I have tried to search help, but cannot find. 回答1: Solved: function g(x){return Math.sin(x)+1}; var F = brd.create('point', [ function(){return s.X();}, function(){return JXG.Math.Numerics.I([-2,s.X()],g);} ],{}); 来源: https://stackoverflow.com/questions/57807057/how-to-access-value-of-integral-with-jsxgraph

How can I shade sections of a JSXGraph board?

半城伤御伤魂 提交于 2019-12-24 20:52:26
问题 I have a jsxgraph board set up with a few simple lines, like this: I want to shade portions of it, for example, the white area between the blue line and the dotted line. What's the best way to go about this? I've looked in the API but none of the provided elements jumped out at me, and I haven't seen any examples so far that do what I'm trying to do. Is the Inequality element easily extendable to multiple lines? 回答1: You can use a polygon and hide the edges and vertices of the polygon. Here

how to make a dynamic function to draw integral Graph from user input with JSXGraph?

只谈情不闲聊 提交于 2019-12-13 06:47:15
问题 I have a problem to make a dynamic graph from this library http://jsxgraph.uni-bayreuth.de/docs/symbols/Integral.html == this will make f(x) = x^3 var c1 = board.create('functiongraph', [function (t) { return t*t*t; }]); var i1 = board.create('integral', [[-1.0, 4.0], c1]); but, how can i make function(t) depends from user input ? for example user input x^2+4x from texboxt and the code will generate this: var fx = $("#fx").val(); // fx = x^2 + 4x var c1 = board.create('functiongraph',

Changing the function in the text box is not changing the graph

蓝咒 提交于 2019-12-12 02:23:50
问题 I am attempting to create a fiddle which can allow me to change the graph through and input text showing below the graph. I am using jsxgraph library for that. http://jsxgraph.uni-bayreuth.de/wiki/index.php/Change_Equation_of_a_Graph#JavaScript_Part Above is the example which is working when you change the function in the text shown graph also changes. Same example I am trying with the fiddle. But it is not working. https://jsfiddle.net/me55dw4h/30/ initial code: board = JXG.JSXGraph

How to fix inequality glitch for JSXgraph?

自闭症网瘾萝莉.ら 提交于 2019-12-11 17:04:01
问题 I'm currently drawing the log10 function on JSXgraph, however the shading glitches. This happens to log, rational, squareRoot functions. Screenshot Log10 function: var graph = board.create('functiongraph', [function (x) { return (a * ((Math.log10(b * (x - h))) / Math.log10(c)) + k); }], { id: field, strokeColor: color, highlightStrokeColor: 'yellow', strokeWidth: 2 }); graph.on('down', function (e, i) { showMaster(this.id); }); graphMap.set(field, graph); //inequality(sym, field, graph, color

How can I make point label draggable in JSXGraph?

柔情痞子 提交于 2019-12-08 12:20:23
问题 I want to make my point label draggable , how can I achieve that in JSXGraph ? I got a link for re positioning polygon label http://jsxgraph.uni-bayreuth.de/wiki/index.php/Positioning_of_labels but How can I change a point label ? 回答1: You can do it like this: board.create('point',[1,1], { name: 'A', label: { fixed:false } }); 来源: https://stackoverflow.com/questions/17468204/how-can-i-make-point-label-draggable-in-jsxgraph