How to Calculate Centroid
问题 I am working with geospatial shapes and looking at the centroid algorithm here, http://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon I have implemented the code in C# like this (which is just this adapted), Finding the centroid of a polygon? class Program { static void Main(string[] args) { List<Point> vertices = new List<Point>(); vertices.Add(new Point() { X = 1, Y = 1 }); vertices.Add(new Point() { X = 1, Y = 10 }); vertices.Add(new Point() { X = 2, Y = 10 }); vertices.Add(new Point()