# Difference between revisions of "Change Equation of a Graph"

From JSXGraph Wiki

Jump to navigationJump to searchLine 47: | Line 47: | ||

</script> | </script> | ||

</html> | </html> | ||

+ | |||

+ | |||

+ | == HowTo of this construction == | ||

+ | Adding a text input field somewhere on the page | ||

+ | <source> | ||

+ | <input type="text" id="eingabe" value="Math.sin(x)*Math.cos(x)"> | ||

+ | </source> | ||

+ | '''Setting up the board''' | ||

+ | <source> | ||

+ | board = JXG.JSXGraph.initBoard('jxgbox', {originX: 250, originY: 250, unitX: 40, unitY: 20}); | ||

+ | // Axes | ||

+ | b1axisx = board.createElement('axis', [[1,0], [0,0]], {}); | ||

+ | b1axisy = board.createElement('axis', [[0,1], [0,0]], {}); | ||

+ | </source> |

## Revision as of 11:48, 15 September 2008

This example shows how you can change the equation of a graph without creating the whole construction again.

## HowTo of this construction

Adding a text input field somewhere on the page

`<input type="text" id="eingabe" value="Math.sin(x)*Math.cos(x)">`

**Setting up the board**

```
board = JXG.JSXGraph.initBoard('jxgbox', {originX: 250, originY: 250, unitX: 40, unitY: 20});
// Axes
b1axisx = board.createElement('axis', [[1,0], [0,0]], {});
b1axisy = board.createElement('axis', [[0,1], [0,0]], {});
```