code: function ( contour ) {
  
  		var n = contour.length;
  		var a = 0.0;
  
  		for ( var p = n - 1, q = 0; q < n; p = q ++ ) {
  
  			a += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y;
  
  		}
  
  		return a * 0.5;
  
  	}
docs: calculate area of the contour polygon