Share JSXGraph: example "Affine ratio"

JSXGraph
Share JSXGraph: example "Affine ratio"
This website is a beta version. The official release will be in **2023**.

Affine ratio

Affine ratio of three points. The more popular name seems to be *simple ratio*, in German *Teilverhältnis*. It is defined as $$ TV(p, q, t) := \lambda \in K \mbox{ such that } \vec{pt} = \lambda\cdot\vec{pq} $$
// Define the id of your board in BOARDID

JXG.Options.label.autoPosition = true;
JXG.Options.label.fontSize = 24;

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

var p = board.create('point', [-3, 0], {
    name: 'p'
});
var q = board.create('point', [3, 0], {
    name: 'q'
});
var pq = board.create('line', [p, q]);
var t = board.create('glider', [-2, 0, pq], {
    name: 't'
});
var txt = board.create('text', [1, 2, () => "λ = " + t.position.toFixed(2)], {
    fontSize: 24
});