Intersection of circles

From JSXGraph Wiki
Revision as of 09:39, 28 March 2020 by A WASSERMANN (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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();