demo/point.quadrant.js
function draw() {

  for (i=0; i<pts.length; i++) {

    // draw corners
    var q = mouseP.quadrant(pts[i], 2);
    var ln = cornerLine(pts[i], q, 12);

    form.stroke( colors["a"+(q%4+1)], 1.5);
    form.line( new Pair(ln.p1.x, ln.y).to( ln.x, ln.y) );
    form.line( new Pair(ln.x, ln.y).to( ln.x, ln.p1.y) );

    // draw point
    form.fill( colors.c4 ).stroke( false );
    form.point( ln.p1, 3, true);
  }

}
function draw() {

  for (i=0; i<pts.length; i++) {

    // draw corners
    var q = mouseP.quadrant(pts[i], 2);
    var ln = cornerLine(pts[i], q, 12);

    form.stroke( colors["a"+(q%4+1)], 1.5);
    form.line( new Pair(ln.p1.x, ln.y).to( ln.x, ln.y) );
    form.line( new Pair(ln.x, ln.y).to( ln.x, ln.p1.y) );

    // draw point
    form.fill( colors.c4 ).stroke( false );
    form.point( ln.p1, 3, true);
  }

}
function draw ( ) { for ( i = 0 ; i < pts . length ; i ++ ) { // draw corners var q = mouseP . quadrant ( pts [ i ] , 2 ) ; var ln = cornerLine ( pts [ i ] , q , 12 ) ; form . stroke ( colors [ "a" + ( q % 4 + 1 ) ] , 1.5 ) ; form . line ( new Pair ( ln . p1 . x , ln . y ) . to ( ln . x , ln . y ) ) ; form . line ( new Pair ( ln . x , ln . y ) . to ( ln . x , ln . p1 . y ) ) ; // draw point form . fill ( colors . c4 ) . stroke ( false ) ; form . point ( ln . p1 , 3 , true ) ; } }
Draw the points
Draw the points