A surgical trajectory guide to guide a medical device to a pivot point has a base that can be attached to a patient, an axial guide member connected with the base and aligned with a pivot point along a first axis in fixed relation to the base and a second axis perpendicular to the first axis. The guide member has a longitudinal axis, and is connected to the base such that the longitudinal axis always passes through the pivot point, and the axial guide member is prevented from rotating around the longitudinal axis. The guide further has at least one electronic angle sensor that can automatically sense a first angle of the axial guide member relative to the local gravity vector about the first axis and a second angle of the axial guide member relative to the local gravity vector about the second axis without having to level the base.