How to get a rotation as a product formed from two other rotations

Suppose we are given two points A and B and a shape Z. Let A90 be rotation by 90 degrees with center A and B90 be rotation by 90 degrees with center B. Then we can generate a symmetric pattern on the whole plane by applying A90 and B90 to Z and the images of Z. In effect we are looking at all shapes Z', where Z' is obtained from Z by an isometry which is a product of powers of A90 and B90. We have done this in lab and the pattern might start out something like this. Two pairs of shapes are colored in a special way to answer the question below.

 

We see that in this figure the shape T is obtained from shape S by C90, the rotation by 90 degrees with center C. So it must be possible to write C90 as a product made up only of A90 and B90. How can we tell what this is?

Notice that by a point symmetry in B there are shapes S1 and T1, with T1 = A90(S1). But S1 = B180(S) = (B90)2(S) and likewise T1 = B180(T) and T = B180(T1).

Putting this together, we see that we can get from S to T as a chain of isometries which take S ->S1->T1->T and this chain can be written in functional notation as T = B180(T1) = B180(A90(S1)) = B180(A90(B180(S))). So we have T = F(S), where F = B902 A90 B902.

Since two isometries that agree on 3 noncollinear points are the same isometry, and since T = C90(S), then C90 = F.