I'm trying to get the corner coordinates of a Square (NOTE, always a square) problematically. (EX: With a formula) and I'm having a hard time adding this into my computer application. Here's an illustration of what I'm trying to do:
Basically, I have the green stars, and I need the blue circles.

Here's what I've tried, but I got lost. I'm not that great with math.
var leftBorder = (center) - (width / 2);
var rightBorder = (center) + (width / 2);
var topBorder = (center) - (height / 2);
var bottomBorder = (center) + (height / 2);
Here's what I came up with, however it's wrong.
BOTTOM_LEFT { X: leftBorder || Y: topBorder - leftBorder }
TOP_LEFT { X: leftBorder || Y: topBorder + leftBorder }
BOTTOM_RIGHT { X: rightBorder || Y: bottomBorder - rightBorder }
TOP_RIGHT { X: rightBorder || Y: bottomBorder + rightBorder }
I'm at a complete loss of ideas.
If the square is axis aligned, the $y$ coordinates are the $\max$ and $\min$ of the $y$ coordinates of your stars and similarly for your $x$'s. Take the four combinations and you are done. I don' read the language you are using. What is $||$ as an operator?