Segments with fixed length: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 9: Line 9:
   seg1 = brd.create('segment', [p0, p1], {strokeColor:'blue'}), // free segment
   seg1 = brd.create('segment', [p0, p1], {strokeColor:'blue'}), // free segment
   seg2 = brd.create('segment', [p2, p3, 2]), // segment of length 2
   seg2 = brd.create('segment', [p2, p3, 2]), // segment of length 2
   seg2 = brd.create('segment', [p2, p3, seg1.L]), // segment of length of seg1
   seg3 = brd.create('segment', [p2, p3, seg1.L]); // segment of length of seg1


</jsxgraph>
</jsxgraph>

Revision as of 10:54, 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});