A method of measuring a position of a surface of an object while the
object is scanned relative to a detection unit in a scanning direction in
an X-Y plane. The detection unit is configured to detect the position of
the surface in a Z direction perpendicular to the X-Y plane. The method
includes a detecting step of scanning the object relative to the
detection unit in two scanning directions opposite to each other, and
detecting, with respect to each of the two scanning directions, a
position of the surface for the same detection point on the surface, a
calculating step of calculating a correction value for correcting a
position of the surface position to be detected by the detection unit,
based on the positions of the surface detected with respect to the two
scanning directions in the detecting step, and a correcting step of
correcting the position of the surface detected by the detection unit
while the object is scanned relative to the detection unit in one of the
two scanning directions, with the correction value obtained in the
calculating step.