Restrict points to limited area

From JSXGraph Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Restrict the points A, B, and C to the lower left quadrant.

The underlying JavaScript code

var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,5,5,-5], axis:true});
var A = brd.create('point', [-1,-1], {name:'A'});
var B = brd.create('point', [-3, -3], {name:'B'});
var C = brd.create('point', [ -2, 0], {name:'C'});

brd.on('move', function() {
   var list = [A, B, C], i;

   for (i = 0; i < list.length; ++i) {
            Math.min(0, list[i].X()), 
            Math.min(0, list[i].Y())