Calculates the Cartesian product of two sets.