The measurement accuracy of the rotation and slope of terrain is a critical factor for the performance of some scene simulation application systems. As the main observed illuminant outdoors, the sun can furnish a rich source of information about the scene. In this paper, we analyze the relationship between the coordinates of the sun in photographs and the zenith and azimuth angles of the camera. By fitting a model of the predicted sun position to the pinhole camera model, we show how to measure the rotation and slope of terrain by using a photograph containing the sun. We test our methods on a sequence of photographs with known camera parameters, and obtain deviation of less than 1.7° for the rotation angle and 2.2° for the slope angle of the terrain. The measuring method by using a photograph containing the sun can be useful for a variety of practical applications such as navigation, time measurement and camera calibration.