public static double computePolygonArea2D(List<ReadOnlyVector3> points){
  if (points.size() < 3) {
    return (0);
  }
  java.util.Iterator<ReadOnlyVector3> iter=points.iterator();
  if (!iter.hasNext()) {
    return 0;
  }
  double area=0;
  ReadOnlyVector3 firstPoint=iter.next();
  ReadOnlyVector3 point=firstPoint;
  while (iter.hasNext()) {
    ReadOnlyVector3 nextLocation=iter.next();
    area+=point.getX() * nextLocation.getY();
    area-=nextLocation.getX() * point.getY();
    point=nextLocation;
  }
  if (!point.equals(firstPoint)) {
    area+=point.getX() * firstPoint.getY();
    area-=firstPoint.getX() * point.getY();
  }
  area/=2.0;
  return area;
}

public static double computePolygonArea2D ( List < ReadOnlyVector3 > points ) { if ( points . size ( ) < 3 ) { return ( 0 ) ; } java . util . Iterator < ReadOnlyVector3 > iter = points . iterator ( ) ; if ( ! iter . hasNext ( ) ) { return 0 ; } double area = 0 ; ReadOnlyVector3 firstPoint = iter . next ( ) ; ReadOnlyVector3 point = firstPoint ; while ( iter . hasNext ( ) ) { ReadOnlyVector3 nextLocation = iter . next ( ) ; area += point . getX ( ) * nextLocation . getY ( ) ; area -= nextLocation . getX ( ) * point . getY ( ) ; point = nextLocation ; } if ( ! point . equals ( firstPoint ) ) { area += point . getX ( ) * firstPoint . getY ( ) ; area -= firstPoint . getX ( ) * point . getY ( ) ; } area /= 2.0 ; return area ; }
returns the area enclosed by the specified ( x , y ) points on a plane ( the z coordinates are ignored ) .
