# Thales Inscribed Angle Theorem Demonstrated Using JSXGraph

Thales inscribed angle theorem states the angle at $$P'$$ below is smaller than that at $$P$$ if $$P$$ is inside the circle, and larger if it is outside the circle. Furthermore, for a fixed segment $$AB$$ inside the circle, the angle at $$P'$$ will always be the same regardless of where on the circle $$P'$$ is, as long as it is on the same side of $$AB.$$

Try moving the points $$P,$$ $$A$$ or $$B$$ around to see how it affects the angles!

## Source Code

window.onload = function() {
var M = 6;
brd = JXG.JSXGraph.initBoard('box',{
boundingbox:[-M,M,M,-M],
grid: false,
});

o = brd.create('point', [0, 0], {name: 'O'});
c = brd.create('circle', [o, 4], {name: 'C'});

a = brd.create('glider', [3, 0, c], {name: 'A'});
b = brd.create('glider', [-3, -3, c], {name: 'B', label:{offset:[-15,0]}});
p = brd.create('point', [-1, 2], {name: 'P'});

opts = {strokeColor: 'blue'};
lab = brd.create('segment', [a, b], opts);

opts = {strokeColor: 'blue'};
lpb = brd.create('segment', [p, b], opts);
lpa = brd.create('segment', [a, p], opts);

op = brd.create('line', [o, p], {visible: false});

pp = brd.create('intersection', [c, op, 0], {name: 'P\'', label:{offset:[0,15]}});
opts = {strokeColor: 'green'};
lppb = brd.create('segment', [pp, b], opts );
lppa = brd.create('segment', [a, pp], opts);
opts = {strokeColor: 'lightblue', strokeWidth: '1px'};
lopp = brd.create('segment', [o, pp], opts);

angp = brd.create('angle', [b, p, a]);
angpp = brd.create('angle', [b, pp, a]);

var setAngleLabels = function() {
angp.setLabelText(angp.Value().toFixed(2));
angpp.setLabelText(angpp.Value().toFixed(2));
};

setAngleLabels();
brd.addHook(function() { setAngleLabels(); }, 'move');
};