Share JSXGraph: example "Elliptic curves: group law"

JSXGraph
Share JSXGraph: example "Elliptic curves: group law"
This website is a beta version. The official release will be in **2024**.

Elliptic curves: group law

Visualization of the group law of points on an elliptic curve. __Attention:__ The curve intersection algorithm always determines $C$ as the third intersection point. In some constellations $C$ will coincide with $A$ or $B$. In that cases the result is wrong.
// Define the id of your board in BOARDID

JXG.Options.label.autoposition = true;

const board = JXG.JSXGraph.initBoard(BOARDID, {
    boundingbox: [-5, 5, 5, -5],
    axis: true
});

var curve = board.create('implicitcurve', ['-(y**2) + x**3 - 2 * x + 1'], {strokeWidth: 2});
var A = board.create('glider', [-1.5, 0, curve]);
var B = board.create('glider', [0, 1, curve]);
var line = board.create('line', [A, B], {color: 'black', strokeWidth: 1});
var C = board.create('intersection', [line, curve, 2]);
var D = board.create('point', [() => C.X(), () => -C.Y()], {name: '-C = A + B'});