using NetTopologySuite.Geometries;
public static void Main()
var coordinatesTopRight = "32.879972662819185,-111.66967792096546";
var coordinatesBottomLeft = "32.873165800037675,-111.6809351312462";
var topRightCoordinates = coordinatesTopRight.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var bottomLeftCoordinates = coordinatesBottomLeft.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var topLeftCoordinate = new Coordinate(Convert.ToDouble(bottomLeftCoordinates[1]), Convert.ToDouble(topRightCoordinates[0]));
var bottomLeftCoordinate = new Coordinate(Convert.ToDouble(bottomLeftCoordinates[1]), Convert.ToDouble(bottomLeftCoordinates[0]));
var bottomRightCoordinate = new Coordinate(Convert.ToDouble(topRightCoordinates[1]), Convert.ToDouble(bottomLeftCoordinates[0]));
var topRightCoordinate = new Coordinate(Convert.ToDouble(topRightCoordinates[1]),Convert.ToDouble(topRightCoordinates[0]));
var polygonCoordinates = new Coordinate[] { topLeftCoordinate, bottomLeftCoordinate, bottomRightCoordinate, topRightCoordinate, topLeftCoordinate };
var geometryFactory = new GeometryFactory(new PrecisionModel(), 4326);
var polygon = new Polygon(new LinearRing(polygonCoordinates), geometryFactory);
Console.WriteLine(polygon.Centroid);