code: function(x, y) {
          var p = this.points,
              l = p.length / 2,
              i,
              j,
              c = false;
  
          for (i = 0, j = l - 1; i < l; j = i++) {
              if (
                  p[2 * i + 1] > y !== p[2 * j + 1] > y &&
                  x <
                      ((p[2 * j] - p[2 * i]) * (y - p[2 * i + 1])) /
                          (p[2 * j + 1] - p[2 * i + 1]) +
                          p[2 * i]
              ) {
                  c = !c;
              }
          }
  
          return c;
      }
docs: @
  #.containsPoint
  @comp Crafty.polygon
  @kind Method
  
  @sign public Boolean .containsPoint(Number x, Number y)
  @param x - X position of the point
  @param y - Y position of the point
  
  Method is used to determine if a given point is contained by the polygon.
  
  @example
  ~~~
  var poly = new Crafty.polygon([50, 0, 100, 100, 0, 100]);
  poly.containsPoint(50, 50); //TRUE
  poly.containsPoint(0, 0); //FALSE
  ~~~