JSX Trigonometrische Funktionen
Aus Wiki1
(Unterschied zwischen Versionen)
Zeile 2: | Zeile 2: | ||
- | < | + | <jsxgraph box="box" width="400" height="400"> |
- | var board = JXG.JSXGraph.initBoard('box', {boundingbox: [- | + | var board = JXG.JSXGraph.initBoard('box', {boundingbox: [-1.33, 1.33, 1.33, -1.33], axis: true}); |
- | + | board.suspendUpdate(); | |
- | + | var b1c1 = board.create('circle', [[0,0], [1,0]]); | |
- | + | var b1p1 = board.create('point', [2, 0], {slideObject: b1c1}); | |
- | + | var perp = board.create('perpendicular', [board.defaultAxes.x,b1p1],[{strokeColor: '#ff0000', visible: true}, {visible: false}]); | |
- | + | var perp2 = board.create('perpendicular',[board.defaultAxes.y,b1p1],[{strokeColor: '#0000ff', visible: true}, {visible: false}]); | |
- | + | board.unsuspendUpdate(); | |
- | + | ||
- | + | // Animation | |
- | var | + | var animated = false; |
- | + | function animate(point, direction, count) { | |
- | + | if(animated) { | |
- | function | + | point.stopAnimation(); |
- | + | animated = false; | |
- | + | } else { | |
+ | point.startAnimation(direction, count); | ||
+ | animated = true; | ||
+ | } | ||
} | } | ||
- | + | </jsxgraph> | |
- | + | ||
- | </ | + | |
[[Kategorie:Bilder]] | [[Kategorie:Bilder]] | ||
[[Kategorie:Wissen]] | [[Kategorie:Wissen]] |
Version vom 17:48, 22. Nov. 2013
Mit Hilfe des Programmpakets JSXGraph (siehe http://jsxgraph.uni-bayreuth.de/wp/) können komplexe, interaktive Grafiken nur mit Hilfe von JavaScript in Webseiten integriert werden. Hier ein Beispiel zur Darstellung der Trigonometrischen Funktionen (der rote Punkt kann mit der Maus bewegt werden!):