The blue square is fixed and the centres of the blue and yellow squares coincide. The yellow square rotates about its centre.

In the middle ages stone masons used a ruler and compasses method to construct exact octagons in a given square window. Open your compasses to a radius of half the diagonal of the square and construct an arc with centre one vertex of the square - mark the 2 points where the arc crosses the sides. Do that for all 4 vertices of the square giving 8 points. Join these points to draw an octagon. Can you prove that the octagon is regular?

You might find the proof by relating the construction to the rotating square. Where does the regular octagon appear when you rotate the yellow square in this diagram?