# Function:s2diskxz

## s2diskxz

Draw a disk in the xz plane at a given y coordinate.

## Prototype

```void s2diskxz(float px, float py, float pz, float r1, float r2); ```

## Description

Draw a disk in the xz plane, at a given y 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 z normalised device units. Note that the disk is infinitely thin and can vanish when viewed edge on. If this is problem, consider using s2circxz to provide an outline for the disk/s.

 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. s2diskxy Draw a disk in the xy plane at a given z 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); s2diskxz(0.0,-0.5,0.0, r1, r2); /* Disk in x-z plane */ s2sci(S2_PG_BLUE); s2diskxz(0.0,+0.5,0.0, r1/2.0, r2/2.0); /* Disk in x-z plane */ s2show(1); /* Open the s2plot window */ return 1; } ```

Back to S2PLOT function list.