main/src/georegression/geometry/UtilPoint2D_F64.java
public static Point2D_F64 mean( List<Point2D_F64> list , Point2D_F64 mean ) {
		if( mean == null )
			mean = new Point2D_F64();

		double x = 0;
		double y = 0;

		for( Point2D_F64 p : list ) {
			x += p.getX();
			y += p.getY();
		}

		x /= list.size();
		y /= list.size();

		mean.set(x, y);
		return mean;
	}
public static Point2D_F64 mean( List<Point2D_F64> list , Point2D_F64 mean ) {
		if( mean == null )
			mean = new Point2D_F64();

		double x = 0;
		double y = 0;

		for( Point2D_F64 p : list ) {
			x += p.getX();
			y += p.getY();
		}

		x /= list.size();
		y /= list.size();

		mean.set(x, y);
		return mean;
	}
public static Point2D_F64 mean ( List < Point2D_F64 > list , Point2D_F64 mean ) { if ( mean == null ) mean = new Point2D_F64 ( ) ; double x = 0 ; double y = 0 ; for ( Point2D_F64 p : list ) { x += p . getX ( ) ; y += p . getY ( ) ; } x /= list . size ( ) ; y /= list . size ( ) ; mean . set ( x , y ) ; return mean ; }
Finds the point which has the mean location of all the points in the list. This is also known
as the centroid.

@param list List of points
@param mean Storage for mean point.  If null then a new instance will be declared
@return The found mean
Finds the point which has the mean location of all the points in the list . This is also known as the centroid .