Intersection of curves II: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
(simplified JSX.Math.Clip to use curveintersection) |
||
(One intermediate revision by one other user not shown) | |||
Line 14: | Line 14: | ||
{strokeColor: 'blue', fillColor: 'red', fillOpacity: 0.3}); | {strokeColor: 'blue', fillColor: 'red', fillOpacity: 0.3}); | ||
var clip = board.create('curveintersection', [curve1, curve2], | |||
{strokeWidth: 3, fillColor: 'yellow', fillOpacity: 0.6 }); | |||
board.update(); | board.update(); | ||
Line 28: | Line 24: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
var board = JXG.JSXGraph.initBoard('jxgbox', { | |||
axis:true, | |||
boundingbox:[-5, 5, 5, -5] | |||
}); | |||
var curve1 = board.create('curve', [ | |||
[-3, 3, 0, -3], | |||
[3, 3, 0, 3] | |||
], | |||
{strokeColor: 'black', fillColor: 'none', fillOpacity: 0.8}); | |||
var curve2 = board.create('polygon', [[3, 4], [-4, 0], [-4, 4]], | |||
{strokeColor: 'blue', fillColor: 'red', fillOpacity: 0.3}); | |||
var clip = board.create('curveintersection', [curve1, curve2], | |||
{strokeWidth: 3, fillColor: 'yellow', fillOpacity: 0.6 }); | |||
</source> | </source> | ||
[[Category:Examples]] | [[Category:Examples]] | ||
[[Category:Curves]] | [[Category:Curves]] |
Latest revision as of 19:00, 18 July 2024
The underlying JavaScript code
var board = JXG.JSXGraph.initBoard('jxgbox', {
axis:true,
boundingbox:[-5, 5, 5, -5]
});
var curve1 = board.create('curve', [
[-3, 3, 0, -3],
[3, 3, 0, 3]
],
{strokeColor: 'black', fillColor: 'none', fillOpacity: 0.8});
var curve2 = board.create('polygon', [[3, 4], [-4, 0], [-4, 4]],
{strokeColor: 'blue', fillColor: 'red', fillOpacity: 0.3});
var clip = board.create('curveintersection', [curve1, curve2],
{strokeWidth: 3, fillColor: 'yellow', fillOpacity: 0.6 });