Trochoid: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 8: Line 8:
  board.createElement('axis', [[0,0],[1,0]]);
  board.createElement('axis', [[0,0],[1,0]]);
  board.createElement('axis', [[0,0],[0,1]]);
  board.createElement('axis', [[0,0],[0,1]]);
  var a = board.createElement('slider', [[1,-1],[4,-1],[-5,1,5]], {style:6});
  var a = board.createElement('slider', [[1,-1],[8,-1],[-5,1,5]], {style:6});
  var b = board.createElement('slider', [[1,-2],[4,-2],[-5,1,5]], {style:6});
  var b = board.createElement('slider', [[1,-2],[8,-2],[-5,1,5]], {style:6});
  var x = function(phi) { return a.Value()*phi-b.Value()*Math.sin(phi); }
  var x = function(phi) { return a.Value()*phi-b.Value()*Math.sin(phi); }
  var y = function(phi) { return a.Value()-b.Value()*Math.cos(phi); }
  var y = function(phi) { return a.Value()-b.Value()*Math.cos(phi); }
  c1 = board.createElement('curve', [x,y,'phi',-Math.PI*4,Math.PI*4],{strokeWidth:3});
  var c1 = board.createElement('curve', [x,y,'phi',-Math.PI*4,Math.PI*4],{strokeWidth:3});
var X = function(phi) { return board.D(y)(phi)/(y(phi)*board.D(x)(phi)-x(phi)*board.D(y)(phi)); }
var Y = function(phi) { return board.D(x)(phi)/(x(phi)*board.D(y)(phi)-y(phi)*board.D(x)(phi)); }
var c2 = board.createElement('curve', [X,Y,'phi',-Math.PI*4,Math.PI*4],{strokeWidth:3});
</script>  
</script>  
</html>
</html>

Revision as of 16:59, 5 February 2009