idlastro / TV Display Procedures: TVELLIPSE

[Source code]

NAME
TVELLIPSE
PURPOSE
Draw an ellipse on the current graphics device.
CALLING SEQUENCE
TVELLIPSE, rmax, rmin, xc, yc, [ pos_ang, color, COLOR= ,/DATA, NPOINTS=
                                  LINESTYLE=, THICK=, /MAJOR, /MINOR ]
INPUTS
RMAX,RMIN - Scalars giving the semi-major and semi-minor axes of
            the ellipse
OPTIONAL INPUTS
XC,YC - Scalars giving the position on the TV of the ellipse center
        If not supplied (or if XC, YC are negative and /DATA is not 
        set), and an interactive graphics device (e.g. not postscript)
        is set,  then the user will be prompted for X,Y
POS_ANG - Position angle of the major axis, measured counter-clockwise
          from the X axis.  Default is 0.
COLOR - Scalar  integer or string specifying color to draw ellipse.   
        See cgcolor.pro for a list of possible color names
OPTIONAL KEYWORD INPUT
COLOR - Intensity value or color name used to draw the circle, 
        overrides parameter value.  Default = 'opposite'
        See cgCOLOR() for a list of color names.;        
DATA - if this keyword is set and non-zero, then the ellipse radii and
       X,Y position center are interpreted as being in DATA
       coordinates.   Note that the data coordinates must have been
       previously defined (with a PLOT or CONTOUR call).  The default
      is to assume data coordinates if !X.CRANGE has been set by a 
      previous plot.    Force device coordinates by setting DATA = 0.
/DEVICE - Set to force use of device coordinates.
/FILL - If set, then fill the ellipse using cgCOLORFILL
NPOINTS - Number of points to connect to draw ellipse, default = 120
          Increase this value to improve smoothness
/MAJOR - Plot a line along the ellipse's major axis
/MINOR - Plot a line along the ellipse's minor axis
       Any keyword recognized by cgPLOTS is also recognized by TVELLIPSE.
       In particular, the color, linestyle, thickness and clipping of
       the ellipses are controlled by the  COLOR, LINESTYLE, THICK and
       NOCLIP keywords.  (Clipping is turned off by default, set
       NOCLIP=0 to activate it.)  If /FILL is set then available 
       keywords include LINE_FILL and FILL_PATTERN. 
RESTRICTIONS
TVELLIPSE does not check whether the ellipse is within the boundaries
of the window.
The ellipse is evaluated at NPOINTS (default = 120) points and
connected by straight lines, rather than using the more sophisticated
algorithm used by TVCIRCLE
TVELLIPSE does not accept normalized coordinates.
TVELLIPSE is not vectorized; it only draws one ellipse at a time
EXAMPLE
Draw an ellipse of semi-major axis 50 pixels, minor axis 30
pixels, centered on (250,100), with the major axis inclined 25
degrees counter-clockwise from the X axis.  Use a double thickness
line and device coordinates
IDL> tvellipse,50,30,250,100,25,thick=2,/device
NOTES
Note that the position angle for TVELLIPSE (counter-clockwise from
the X axis) differs from the astronomical position angle
(counter-clockwise from the Y axis).
REVISION HISTORY
Written  W. Landsman STX          July, 1989
Converted to use with a workstation.  M. Greason, STX, June 1990
LINESTYLE keyword, evaluate at 120 points,  W. Landsman HSTX Nov 1995
Added NPOINTS keyword, fixed /DATA keyword W. Landsman HSTX Jan 1996
Check for reversed /DATA coordinates  P. Mangiafico, W.Landsman May 1996
Work correctly when X & Y data scales are unequal  December 1998
Removed cursor input when -ve coords are entered with /data
keyword set  P. Maxted, Keele, 2002
Use _EXTRA keywords including NOCLIP  W. Landsman October 2006
Add plotting of major and minor axes and /MAJOR, /MINOR keywords;
fixed description of RMAX,RMIN (semi-axes).  J. Guerber Feb. 2007
Update to use Coyote graphics W. Landsman Feb 2011
Default to data coordinates if a previous plot has been made 
(X.crange is non-zero)  W. Landsman Jan 2012
Added /DEVICE keyword W. Landsman   Mar 2012
Added /FILL keyword  W. Landsman Mar 2012