Intersection of circles: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) (Created page with "<jsxgraph box="jxgbox" width="600" height="600"> var board = JXG.JSXGraph.initBoard('jxgbox', { axis:true, boundingbox:[-15, 10, 10, -10] }); var c1 = board.create('c...") |
A WASSERMANN (talk | contribs) No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
var board = JXG.JSXGraph.initBoard('jxgbox', { | var board = JXG.JSXGraph.initBoard('jxgbox', { | ||
axis:true, | axis:true, | ||
boundingbox:[- | boundingbox:[-5, 5, 5, -5] | ||
}); | }); | ||
var c1 = board.create('circle', [[-1, | var c1 = board.create('circle', [[-1, 1.5], 3]); | ||
var c2 = board.create('circle', [[1, | var c2 = board.create('circle', [[1, -1.5], 3]); | ||
var clip_path = board.create('curve', [[], []], {strokeWidth: 2, fillColor: 'yellow', fillOpacity: 0.3}); | var clip_path = board.create('curve', [[], []], {strokeWidth: 2, fillColor: 'yellow', fillOpacity: 0.3}); | ||
Line 22: | Line 22: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
var board = JXG.JSXGraph.initBoard('jxgbox', { | |||
axis:true, | |||
boundingbox:[-5, 5, 5, -5] | |||
}); | |||
var c1 = board.create('circle', [[-1, 1.5], 3]); | |||
var c2 = board.create('circle', [[1, -1.5], 3]); | |||
var clip_path = board.create('curve', [[], []], {strokeWidth: 2, fillColor: 'yellow', fillOpacity: 0.3}); | |||
clip_path.updateDataArray = function() { | |||
var a = JXG.Math.Clip.intersection(c1, c2, this.board); | |||
this.dataX = a[0]; | |||
this.dataY = a[1]; | |||
}; | |||
board.update(); | |||
</source> | </source> | ||
[[Category:Examples]] | [[Category:Examples]] | ||
[[Category:Geometry]] | [[Category:Geometry]] |
Revision as of 09:39, 28 March 2020
The underlying JavaScript code
var board = JXG.JSXGraph.initBoard('jxgbox', {
axis:true,
boundingbox:[-5, 5, 5, -5]
});
var c1 = board.create('circle', [[-1, 1.5], 3]);
var c2 = board.create('circle', [[1, -1.5], 3]);
var clip_path = board.create('curve', [[], []], {strokeWidth: 2, fillColor: 'yellow', fillOpacity: 0.3});
clip_path.updateDataArray = function() {
var a = JXG.Math.Clip.intersection(c1, c2, this.board);
this.dataX = a[0];
this.dataY = a[1];
};
board.update();