PRO hess_equ, theta, phi, X, D1, D2, D3
;+
; Implement Dan's 4/9/91 equations for location of RC given
; angular position.
;
; Inputs:
;	theta	off-axis "lattitude"
;	phi	azimuthal location, 0 deg is along dispersion axis
;	X	Rowland diameter
; Outputs:
;	D1	cross-dispersion location w.r.t. axis
;	D2	axial location w.r.t. on-axis location,
;		positive towards focus
;	D3	dispersion direction location w.r.t. axis
;
; 11/22/94 dd
;-

; Calculate Rowland Torus angles
; torus coordinate phi
prt = ATAN(TAN(theta)*SIN(phi))
; torus coordinate theta
trt = 2.0 * ATAN(TAN(theta)*COS(phi)*COS(prt))


; Calculate point location in space
one_prime = X * SIN(prt) *( (1./COS(prt)) - $
			(1.+COS(trt))/2. )
D1 = X * TAN(theta)*SIN(phi) - one_prime
D2 = X * COS(prt) * ( (1./COS(prt)) - $
			(1.+COS(trt))/2. )
D3 = (X/2.) * SIN(trt)

RETURN
END

