There are two primary problems with this code:
- There's a lot of duplicated code, differing only in the axes used. These could somehow derive from a common base class, with appropriate virtuals.
- Only the
xz_rect class has pdf_value() and random() member functions.