# Difference between revisions of "Curve"

From JSXGraph Wiki

Jump to navigationJump to search (New page: There are various possibilities to display curves and plots. JSXGraph supports the following curve types which can be set by changing the property "curveType". In many cases JSXGraph can g...) |
|||

Line 17: | Line 17: | ||

<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/prototype.js"></script> | <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/prototype.js"></script> | ||

<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script> | <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script> | ||

− | <div id="jxgbox" class="jxgbox" style="width: | + | <div id="jxgbox" class="jxgbox" style="width:600px; height:400px;"></div> |

<script type="text/javascript"> | <script type="text/javascript"> | ||

var b = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 200, unitX: 20, unitY: 20}); | var b = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 200, unitX: 20, unitY: 20}); |

## Revision as of 10:47, 19 September 2008

There are various possibilities to display curves and plots. JSXGraph supports the following curve types which can be set by changing the property "curveType". In many cases JSXGraph can guess the curveType from the input parameters, but sometimes the curveType has to be set explicitly.

- 'plot': function plotter
- 'parameter': parameter curves.
- 'graph': data plot
- 'polar': polar curves

## Function plotter - curveType:'plot'

First, we initialize the board and set axes:

```
var b = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 200, unitX: 20, unitY: 20});
axisx = b.createElement('axis', [[1,0], [0,0]], {});
axisy = b.createElement('axis', [[0,1], [0,0]], {});
```