Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a point on the graph at position X,Y , and I have to draw a square around that point of side X m. I have described my problem in the image.


I have taken an example square of 3 m. The diagonal of this square is 4.24 m(approx). I need to find the coordinates of the sides of the square.

share|cite|improve this question
You also need to specify the orientation of the square. – joriki Dec 12 '12 at 7:35
@joriki Orientation? Do you mean 2D,3D? If so, it's a 2D square. – Abijeet Patro Dec 12 '12 at 8:33
A square is always two-dimensional. I presume you're referring to the dimensionality of the space. I was a assuming that you're working in the plane and was referring to the angular orientation of the square within the plane. Clearly the coordinates of the slanted square that you drew differ from the coordinates of an axis-parallel square that ashley provided, and depend on the angular orientation. – joriki Dec 12 '12 at 9:04
If I understand this correctly then, the square will not be slanted at all, I'm sorry that the image does not depict that correctly. – Abijeet Patro Dec 12 '12 at 18:44
up vote 1 down vote accepted

If your point is $(x,y)$ and side length is $k$, the coordinates of the square of which the sides are parallel to the x- and y-axes are $(x+n, y+n)$, $(x+n, y-n)$, $(x-n, y+n)$, $(x-n, y-n)$ where $n=k*sqrt(2)/2$. If you want angles by the axes, rotate.

share|cite|improve this answer
This looks like it'll do the trick, I'll check and get back :) – Abijeet Patro Dec 12 '12 at 18:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.