Analytical aberration theory for plane-symmetric optical systems and its application in the analysis of distortion in freeform spectrometers