INTERFACE PlanetLighting; (* This module provides tools for lighting computations on planetary images, such as finding the sun direction vector from the position of the terminator, and computing the areal illumination and light direction at any point on the planet's surface. *) TYPE T = RECORD sunDir: LR3.T; (* Sun direction, planet coords. *) maxLight: LONG; (* Nominal surface brightness at subsolar point. *) minLight: LONG; (* Nominal surface brightness of dark hemisphere. *) bias: LONG; (* Illumination bias, to shift terminator. *) END; PROCEDURE Compute(~)~ (* This procedure determines the direction vector "sunDir" of the sun, in planet-relative coordinates. This vector is either given explicitly by the user (the program merely normalizes it), or computed from two points on the terminator (which must be given counterclockwise as seen from the lighted hemisphere). If "D" not specified, the sphere is assumed to be illuminated frontally, i.e. "sunDir=(0,0,1)". *) END PlanetLighting.