Circles on circles: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 15: | Line 15: | ||
slide: function(event, ui) { | slide: function(event, ui) { | ||
$("#c1").val(ui.value*0.01); | $("#c1").val(ui.value*0.01); | ||
c1 = ui.value*0.01; | |||
board.update(); | |||
} | } | ||
}); | }); | ||
Line 29: | Line 31: | ||
$("#sliderc2").slider({ | $("#sliderc2").slider({ | ||
orientation: "horizontal",range: "min",min: 0,max: 100,value: | orientation: "horizontal",range: "min",min: 0,max: 100,value: 30, | ||
slide: function(event, ui) { | slide: function(event, ui) { | ||
$("#c2").val(ui.value*0.01); | $("#c2").val(ui.value*0.01); | ||
c2 = ui.value*0.01; | |||
board.update(); | |||
} | } | ||
}); | }); | ||
Line 38: | Line 42: | ||
slide: function(event, ui) { | slide: function(event, ui) { | ||
$("#f2").val(ui.value); | $("#f2").val(ui.value); | ||
f2 = ui.value; | |||
board.update(); | |||
} | } | ||
}); | }); | ||
Line 65: | Line 71: | ||
board = JXG.JSXGraph.initBoard('jsxgbox', {originX: 250, originY: 250, unitX: 100, unitY: 100}); | board = JXG.JSXGraph.initBoard('jsxgbox', {originX: 250, originY: 250, unitX: 100, unitY: 100}); | ||
alert($("#c1").value); | alert($("#c1").value); | ||
var c1 = | var c1 = 0.6; | ||
var c2 = 0. | var c2 = 0.3; | ||
var f1 = 7; | var f1 = 7; | ||
var f2 = 17; | var f2 = 17; | ||
var c = board.createElement('curve', [ | var c = board.createElement('curve', [ | ||
function(t) { return Math.cos(t)+ c1*Math.cos(f1*t);}, | function(t) { return Math.cos(t)+ c1*Math.cos(f1*t)+ c2*Math.cos(f2*t);}, | ||
function(t) { return Math.sin(t)+ c1*Math.sin(f1* | function(t) { return Math.sin(t)+ c1*Math.sin(f1*t)+ c2*Math.sin(f2*t);}, | ||
0,2*Math.PI]); | |||
</script> | </script> | ||
</html> | </html> |
Revision as of 11:07, 29 June 2009