; NAME : matrix_tn ; PURPOSE : ; conversion from data to tangential coordinates ; CATEGORY : ; solar magnetic field computation package (MAGPACK2) ; CALLING SEQUENCE : ; atmat = matrix_t ( position ) ; INPUTS : ; position : position on the solar disk, [ ew, ns ] ; disk center => [0,0], limb => +-1. ; OPTIONAL INPUT PARAMETERS : ; none ; KEYWORD PARAMETERS : ; none ; OUTPUTS : ; atmat ( floating array of 3x3 ) ; COMMON BLOCKS : none ; SIDE EFFECTS : none ; RESTRICTIONS : none ; PROCEDURE : ; ; MODIFICATION HISTORY : ; T.Sakurai, 1992 ; K.Ichimoto, 1992/10/19 modify for "location" ; ;------------------------------------------------------------------------ ; function matrix_tn, position ; halfpi = 0.5*3.141592 xt = position(0) yt = position(1) rsp = 1. ; -- radius zt2 = rsp*rsp - xt*xt - yt*yt if zt2 ge 0.0 then zt = sqrt(zt2) else zt = -rsp if yt gt rsp then begin theta = !pi/2. endif else begin if yt lt -rsp then begin theta = -!pi/2. endif else begin theta = acos(yt/rsp) endelse endelse als = halfpi - theta aps = atan( xt, zt ) sinals=sin(als) cosals=cos(als) sinaps=sin(aps) cosaps=cos(aps) atmat = fltarr(3,3) atmat(0,0)= cosaps atmat(0,1)=-sinaps*sinals atmat(0,2)= sinaps*cosals atmat(1,0)= 0.0 atmat(1,1)= cosals atmat(1,2)= sinals atmat(2,0)=-sinaps atmat(2,1)=-cosaps*sinals atmat(2,2)= cosaps*cosals return, atmat end