Analytical representation of spot diagrams and its application to the design of monochromators