Determining if figures are congruent and related by a sequence of transformations