A non-transitory computer readable medium storing shape measurement program for measuring a shape of an object to be measured by irradiating a surface of the object to be measured with a line-shaped pattern, which is generated by adjusting an intensity distribution of light emitted from a light source or by scanning light emitted from a light source, and causing the probe to detect an image of the line-shaped pattern projected onto the object to be measured, the program causing a computer to execute:
- rotating the object to be measured and the probe relative to each other so that the object to be measured rotates relative to the probe around a rotation axis and linearly moving at least one of the probe and the object to be measured relatively in at least a radial direction that intersects with a rotation direction of the relative rotational movement;
- and
- controlling a movement mechanism for moving the probe relative to the object such that a maximum optical probe movement amount per single rotation is controlled in accordance with an angle of tilt between the orientation of the line-shaped pattern and a line perpendicular to the rotation direction in a measurement plane of the object to be measured.