JSXGraph and sound: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 8: Line 8:
Gibberish.Binops.export();
Gibberish.Binops.export();


var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-1,10,10,-10], axis:true});
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-1,10,10,-10], axis:false});


var slide = board.create('slider', [[2, 8], [8, 8], [100, 440, 1000]]);
var slide = board.create('slider', [[2, 8], [8, 8], [100, 440, 1000]]);
var sinewave = new Gibberish.Sine( 440, .25 ).connect();
var sinewave = new Gibberish.Sine( 440, .25 ).connect();
var sinecurve = board.create('functiongraph', [function(x) { return 5 * Math.sin(2.2 * 2* Math.PI * x); }]);
var sinecurve = board.create('functiongraph', [function(x) { return 5 * Math.sin((sinewave.frequeny / 200.0) * 2* Math.PI * x); }]);
board.on('update', function() {
board.on('update', function() {
     sinewave.frequency = slide.Value();
     sinewave.frequency = slide.Value();

Revision as of 15:48, 6 February 2014

JSXGraph and sound