Text this: Analytic Design of Segmented Phase Grating for Optical Sensing in High-Precision Alignment System