Function:s2diskxy

From S2PLOT

Revision as of 07:23, 27 October 2007; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

s2diskxy

Draw a disk in the xy plane at a given z coordinate.

Prototype

void s2diskxy(float px, float py, float pz, float r1, float r2);

Description

Draw a disk in the xy plane, at a given z coordinate. The disk has an inner and outer radius and the annulus is filled. Thus you can draw solid circles (r1 = 0, r2 > 0), circle outlines (r1 > 0, r2 = r1+eps) and all things in between. The radius is given in world coordinates, and the actual radius used is the quadratic mean of the radius converted to x and y normalised device units. Note that the disk is infinitely thin and can vanish when viewed edge on. If this is problem, consider using s2circxy to provide an outline for the disk/s.

See Also

s2circxy Draw a circle in the xy plane at a given z coordinate.
s2circyz Draw a circle in the yz plane at a given x coordinate.
s2circyz Draw a circle in the yz plane at a given x coordinate.
s2diskxz Draw a disk in the xz plane at a given y coordinate.
s2diskyz Draw a disk in the yz plane at a given x coordinate.


Code Example

#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"

int main(int argc, char *argv[])
{
   float r1  = 0.5;				/* Inner radius */
   float r2  = 0.8;				/* Outer radius */

   s2opend("/?",argc, argv);			/* Open the display */
   s2swin(-1.,1., -1.,1., -1.,1.);		/* Set the window coordinates */
   s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0);	/* Draw coordinate box */
   s2sci(S2_PG_RED);
   s2diskxy(0.0,0.0,-0.5, r1, r2);		/* Disk in x-y plane */
   s2sci(S2_PG_BLUE);
   s2diskxy(0.0,0.0,+0.5, r1/2.0, r2/2.0);	/* Disk in x-y plane */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools