Locus computation: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 2: Line 2:
JXG.serverBase = 'http://jsxgraph.uni-bayreuth.de/distrib/server/';
JXG.serverBase = 'http://jsxgraph.uni-bayreuth.de/distrib/server/';
board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-2, 20, 20, -2], axis: true, grid: false, keepaspectratio: true});
board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-2, 20, 20, -2], axis: true, grid: false, keepaspectratio: true});
     p3 = board.createElement('point', [8, 3]);
     p3 = board.create('point', [8, 3]);
     p4 = board.createElement('point', [8, 8]);
     p4 = board.create('point', [8, 8]);
     c1 = board.createElement('circle', [p4, 4]);
     c1 = board.create('circle', [p4, 4]);


     p6 = board.createElement('glider', [0, 0, c1], {name:"D"});
     p6 = board.create('glider', [0, 0, c1], {name:"D"});
     g = board.createElement('line', [p3, p6]);
     g = board.create('line', [p3, p6]);


     c2 = board.createElement('circle', [p6, 3]);
     c2 = board.create('circle', [p6, 3]);


     p14_1 = board.createElement('intersection', [c2,g,0], {name: "T"});
     p14_1 = board.create('intersection', [c2,g,0], {name: "T"});


     loc = board.createElement('locus', [p14_1], {strokeColor: 'red', strokeWidth: 1});
     loc = board.create('locus', [p14_1], {strokeColor: 'red', strokeWidth: 1});
</jsxgraph>
</jsxgraph>


Line 20: Line 20:
JXG.serverBase = 'http://jsxgraph.uni-bayreuth.de/distrib/server/';
JXG.serverBase = 'http://jsxgraph.uni-bayreuth.de/distrib/server/';
board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-2, 20, 20, -2], axis: true, grid: false, keepaspectratio: true});
board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-2, 20, 20, -2], axis: true, grid: false, keepaspectratio: true});
p3 = board.createElement('point', [8, 3]);
p3 = board.create('point', [8, 3]);
p4 = board.createElement('point', [8, 8]);
p4 = board.create('point', [8, 8]);
c1 = board.createElement('circle', [p4, 4]);
c1 = board.create('circle', [p4, 4]);
p6 = board.createElement('glider', [0, 0, c1], {name:"D"});
p6 = board.create('glider', [0, 0, c1], {name:"D"});
g = board.createElement('line', [p3, p6]);
g = board.create('line', [p3, p6]);
c2 = board.createElement('circle', [p6, 3]);
c2 = board.create('circle', [p6, 3]);
tracer = board.createElement('intersection', [c2,g,0], {name: "T"});
tracer = board.create('intersection', [c2,g,0], {name: "T"});


loc = board.createElement('locus', [tracer], {strokeColor: 'red', strokeWidth: 1});
loc = board.create('locus', [tracer], {strokeColor: 'red', strokeWidth: 1});
</source>
</source>


[[Category:Examples]]
[[Category:Examples]]
[[Category:Geometry]]
[[Category:Geometry]]

Revision as of 09:45, 8 May 2020

The underlying JavaScript code

JXG.serverBase = 'http://jsxgraph.uni-bayreuth.de/distrib/server/';
board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-2, 20, 20, -2], axis: true, grid: false, keepaspectratio: true});
p3 = board.create('point', [8, 3]);
p4 = board.create('point', [8, 8]);
c1 = board.create('circle', [p4, 4]);
p6 = board.create('glider', [0, 0, c1], {name:"D"});
g = board.create('line', [p3, p6]);
c2 = board.create('circle', [p6, 3]);
tracer = board.create('intersection', [c2,g,0], {name: "T"});

loc = board.create('locus', [tracer], {strokeColor: 'red', strokeWidth: 1});