This paper presents a new differential method called the mixed method, which was developed to measure the profile accurately under the circumstances of on-machine measurement. In comparison with the 2-point method, this method can more remarkably reduce the datum errors due to scanning, vibration and thermal drift. This method also has the advantage of obtaining the high-frequency component of profiles accurately. An optical sensor was designed and constructed to realize both the 2-point method and the mixed method. With a modulation technique, the sensor has been made to have good thermal dritt characteristics. It can measure the displacement and angle of two points on a mirror surface simultaneously with a resolution higher than 0.1 mum and 1''. Using this sensor, an on-machine measurement system has been constructed, and measurements of the straightness of cylindrical mirrors have been attempted with the 2-point method and the mixed method. Comparing the results, the favorable characteristics of the mixed method have been confirmed.