;------------------------------------------------------------- ;+ ; NAME: ; ELLIPSE ; PURPOSE: ; Plot specified ellipse on the current plot device. ; CATEGORY: ; CALLING SEQUENCE: ; ellipse, a, b, tilt, a1, a2, [x0, y0] ; INPUTS: ; a = major axis of ellipse (data units). in ; b = minor axis of ellipse (data units). in ; [tilt] = angle of major axis (deg CCW from X axis, def=0). in ; [a1] = Start angle of arc (deg CCW from major axis, def=0). in ; [a2] = End angle of arc (deg CCW from major axis, def=360). in ; [x0, y0] = optional arc center (def=0,0). in ; KEYWORD PARAMETERS: ; Keywords: ; /DEVICE means use device coordinates . ; /DATA means use data coordinates (default). ; /NORM means use normalized coordinates. ; COLOR=c plot color (scalar or array). ; LINESTYLE=l linestyle (scalar or array). ; OUTPUTS: ; COMMON BLOCKS: ; NOTES: ; Note: all parameters may be scalars or arrays. ; MODIFICATION HISTORY: ; Written by R. Sterner, 12 July, 1988. ; Johns Hopkins University Applied Physics Laboratory. ; RES 15 Sep, 1989 --- converted to SUN. ; R. Sterner, 17 Jun, 1992 --- added coordinate systems, cleaned up. ; D P Steele, ISR, 27 Oct. 1994: modified from ARCS.PRO by R. Sterner. ; ; Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory ; This software may be used, copied, or redistributed as long as it is not ; sold and this copyright notice is reproduced on each copy made. This ; routine is provided as is without any express or implied warranties ; whatsoever. Other limitations apply as described in the file disclaimer.txt. ;- ;------------------------------------------------------------- pro ellipse, a, b, tilt, a1, a2, xx, yy, help=hlp,$ color=clr, linestyle=lstyl, $ device=device, data=data, norm=norm, $ debug=debug np = n_params(0) if (np lt 1) or keyword_set(hlp) then begin doc_library,'ellipse' return endif ;------ Determine coordinate system ----- if n_elements(device) eq 0 then device = 0 ; Define flags. if n_elements(data) eq 0 then data = 0 if n_elements(norm) eq 0 then norm = 0 if device+data+norm eq 0 then data = 1 ; Default to data. if n_elements(clr) eq 0 then clr = !p.color if n_elements(lstyl) eq 0 then lstyl = !p.linestyle a=FLOAT(a) b=FLOAT(b) tilt=FLOAT(tilt) if np lt 3 then tilt = 0. if np lt 4 then a1 = 0. if np lt 5 then a2 = 360. if np lt 6 then xx = 0. if np lt 7 then yy = 0. na = n_elements(a)-1 ; Array sizes. nb = n_elements(b)-1 ; Array sizes. nt=N_ELEMENTS(tilt)-1 na1 = n_elements(a1)-1 na2 = n_elements(a2)-1 nxx = n_elements(xx)-1 nyy = n_elements(yy)-1 nclr = n_elements(clr)-1 nlstyl = n_elements(lstyl)-1 n = na>nb>nt>na1>na2>nxx>nyy ; Overall max. for i = 0, n do begin ; loop thru ellipse. ai = a(i