demo/point.quadrant.js
function cornerLine(p, quadrant, size) {

  switch (quadrant) {
    case Const.top_left: return new Pair(p).to(p.$add(size, size));
    case Const.top_right: return new Pair(p).to(p.$add(-size, size));
    case Const.bottom_left: return new Pair(p).to(p.$add(size, -size));
    case Const.bottom_right: return new Pair(p).to(p.$add(-size, -size));
    case Const.top: return new Pair(p).to(p.$add(0, size));
    case Const.bottom: return new Pair(p).to(p.$add(0, -size));
    case Const.left: return new Pair(p).to(p.$add(size, 0));
    default: return new Pair(p).to(p.$add(-size, 0));
  }
}
function cornerLine(p, quadrant, size) {

  switch (quadrant) {
    case Const.top_left: return new Pair(p).to(p.$add(size, size));
    case Const.top_right: return new Pair(p).to(p.$add(-size, size));
    case Const.bottom_left: return new Pair(p).to(p.$add(size, -size));
    case Const.bottom_right: return new Pair(p).to(p.$add(-size, -size));
    case Const.top: return new Pair(p).to(p.$add(0, size));
    case Const.bottom: return new Pair(p).to(p.$add(0, -size));
    case Const.left: return new Pair(p).to(p.$add(size, 0));
    default: return new Pair(p).to(p.$add(-size, 0));
  }
}
function cornerLine ( p , quadrant , size ) { switch ( quadrant ) { case Const . top_left : return new Pair ( p ) . to ( p . $add ( size , size ) ) ; case Const . top_right : return new Pair ( p ) . to ( p . $add ( - size , size ) ) ; case Const . bottom_left : return new Pair ( p ) . to ( p . $add ( size , - size ) ) ; case Const . bottom_right : return new Pair ( p ) . to ( p . $add ( - size , - size ) ) ; case Const . top : return new Pair ( p ) . to ( p . $add ( 0 , size ) ) ; case Const . bottom : return new Pair ( p ) . to ( p . $add ( 0 , - size ) ) ; case Const . left : return new Pair ( p ) . to ( p . $add ( size , 0 ) ) ; default : return new Pair ( p ) . to ( p . $add ( - size , 0 ) ) ; } }
Get a line indicating the quadrant
Get a line indicating the quadrant