Intersection of functiongraphs

From JSXGraph Wiki
Revision as of 18:54, 18 July 2024 by TomBerend (talk | contribs) (Simplify from JSX.Math.Clip to curveintersection, but also the old code shaded the WRONG area.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The underlying JavaScript code

var board = JXG.JSXGraph.initBoard('jxgbox', {
    axis:true,
    boundingbox:[-5, 10, 10, -5]
});

var curve1 = board.create('functiongraph', ['x^2-2'], {strokeColor: 'blue', fixed: false});
var curve2 = board.create('functiongraph', ['4/x', 0.001, 20], {strokeColor: 'black', fixed: false});

var clip = board.create('curveintersection', [curve1, curve2], 
         {strokeWidth: 2, fillColor: 'yellow', fillOpacity: 0.3 });