0
$\begingroup$

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.

Example

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.

  • 2
    You also need to specify the orientation of the square.2012-12-12
  • 0
    @joriki Orientation? Do you mean 2D,3D? If so, it's a 2D square.2012-12-12
  • 2
    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.2012-12-12
  • 0
    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.2012-12-12

1 Answers 1

1

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.

  • 0
    This looks like it'll do the trick, I'll check and get back :)2012-12-12