All frame-based stereotactic procedures require localization of an anatomical target within the coordinate system of the stereotactic frame. If the target is defined by its coordinates given in a stereotactic atlas (indirect localization), the neurosurgeon faces the mathematical task of transforming atlas coordinates into frame coordinates. In the method usually used, the frame coordinates of two reference points (the anterior and posterior commissures) are obtained from computerized tomography or magnetic resonance images, and serve as the basis for the coordinate transformation. This two-point algorithm relies on the additional assumption that the frame sits on the patient's head without exhibiting roll, that is, rotation about the anteroposterior axis (y axis). Usually this assumption is nearly, but not exactly, correct. An amount of roll as small as 3 degrees can cause a targeting error on the order of 1 mm when a two-point algorithm is used. This potential source of error can be eliminated by using a new method of coordinate transformation, the derivation of which is mathematically reported in this article. The new method requires a third reference point located in the midsagittal plane, in addition to the two commissural reference points.