function containmentTest(arc) {
      var startAngle = signedAngle(arc.startAngle);
      var endAngle = signedAngle(arc.endAngle);

      if (startAngle > endAngle) {
      	var tmp = startAngle;
      	startAngle = endAngle;
      	endAngle = tmp;
      }

      // test if segment angle is contained in angle interval
      return function(a) {

        if (a >= startAngle && a <= endAngle) {
          return true;
        }

        return false;
      };
    }
angles are stored in radians from in [0, 2*PI], where 0 in 12 o'clock.
However, one can only select lines from 0 to PI, so we compute the
'signed' angle, where 0 is the horizontal line (3 o'clock), and +/- PI/2
are 12 and 6 o'clock respectively.