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 small square inscribed by an outer square, where the degree of tilt is given by theta. The length of the outer square is also given by L.

If I were to rotate the inner square by the red center point to set it up right (what was in gray becomes purple in the image), I have 2 "parallel" squares, leaving a margin between the two. What I need to know is the width of the margin, or the width of the inner square (given any one, the other would be easy to find anyways.)

How do I go about this mathematically?

what is the width of the margin?

share|cite|improve this question
up vote 2 down vote accepted

Looking at the triangle with $\theta$ marked in the figure, the hypotenuse is the width $w$ of the inner square, and the legs are $w \cos(\theta)$ and $w \sin(\theta)$. Note that the lengths of the legs add up to L.

$$w \cos(\theta) + w \sin(\theta) = L$$ $$w [\cos(\theta) + \sin(\theta)] = L$$ $$w = \frac{L}{\cos(\theta) + \sin(\theta)}$$

Here, $w$ is the width of the inner square, not the width of the margin.

If you want to minimize the number of trig functions, you could use the formula $$\cos(\theta) + \sin(\theta) = \sqrt{2} \sin(\theta + 45^\circ)$$

share|cite|improve this answer

If the side length of the smaller square is $S$, then $L=S \sin \theta + S \cos \theta$, and the width of the gap is $(L-S)/2$.

share|cite|improve this answer

First, I denote some notation: call the outer length L, the length of the hypotenuse of the triangles h, the length of the small side s, and the length of the large side l. Then we have also that $l + s = L$ and also that $tan(\theta) = \dfrac{s}{l}$.

Solving for s, we see that $s = ltan(\theta)$. Then we can solve for s and l using the known length L. A final use of the Pythagorean Theorem yields the inner square length as well.

share|cite|improve this answer

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.