How to find the Center Coordinate of Rectangle?
The center of rectangle is the midpoint of the diagonal end points of rectangle.
Here the midpoint is ( (x1 + x2) / 2, (y1 + y2) / 2 )
.
That means:xCenter = (x1 + x2) / 2
yCenter = (y1 + y2) / 2
Let me know your code.
Center x = x + 1/2 of width
Center y = y + 1/2 of height
If you know the width and height already then you only need one set of coordinates.