Magnetized points: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) (Created page with "<jsxgraph width="400" height="400" box="box"> snatchDistance:2}); var brd = JXG.JSXGraph.initBoard('box', {axis:false, boundingbox: [-5, 5, 5, -5]}), li = brd.create('line', [...") |
A WASSERMANN (talk | contribs) No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<jsxgraph width="400" height="400" box="box"> | <jsxgraph width="400" height="400" box="box"> | ||
var brd = JXG.JSXGraph.initBoard('box', {axis:false, boundingbox: [-5, 5, 5, -5]}), | var brd = JXG.JSXGraph.initBoard('box', {axis:false, boundingbox: [-5, 5, 5, -5]}), | ||
li = brd.create('line', [1,2,3]), | li = brd.create('line', [1,2,3]), | ||
p = brd.create('point', [ | ci = brd.create('circle', [[2,2],1]), | ||
p0 = brd.create('point', [-2,0], {color:'blue'}), | |||
p = brd.create('point', [-2,-2], {attractors: [li,ci,p0], attractorDistance:0.2, snatchDistance: 2}); | |||
</jsxgraph> | </jsxgraph> | ||
===The underlying JavaScript code=== | ===The underlying JavaScript code=== | ||
<source lang="javascript"> | <source lang="javascript"> | ||
var brd = JXG.JSXGraph.initBoard('box', {axis:false, boundingbox: [-5, 5, 5, -5]}), | |||
li = brd.create('line', [1,2,3]), | |||
ci = brd.create('circle', [[2,2],1]), | |||
p0 = brd.create('point', [-2,0], {color:'blue'}), | |||
p = brd.create('point', [-2,-2], {attractors: [li,ci,p0], attractorDistance:0.2, snatchDistance: 2}); | |||
</source> | </source> | ||
[[Category:Examples]] | [[Category:Examples]] |
Latest revision as of 10:45, 26 January 2012
The underlying JavaScript code
var brd = JXG.JSXGraph.initBoard('box', {axis:false, boundingbox: [-5, 5, 5, -5]}),
li = brd.create('line', [1,2,3]),
ci = brd.create('circle', [[2,2],1]),
p0 = brd.create('point', [-2,0], {color:'blue'}),
p = brd.create('point', [-2,-2], {attractors: [li,ci,p0], attractorDistance:0.2, snatchDistance: 2});