Function:s2rectyz

From S2PLOT

(Difference between revisions)
Jump to: navigation, search

Current revision

s2rectyz

Draw a rectangle in the yz plane at a given x coordinate.

Prototype

void s2rectyz(float ymin, float ymax, float zmin, float zmax, float x);

Description

Draw a rectangle in the yz plane, at a given x coordinate. The rectangle is a filled quadrangle. The edge of the rectangle is NOT drawn. Use s2line if you need a border to your rectangle/s.

See Also

s2rectxy Draw a rectangle in the xy plane at a given z coordinate.
s2rectxz Draw a rectangle in the xz plane at a given y coordinate.
s2line Draw a poly line, n vertices at (xpts, ypts, zpts).

PGPLOT Equivalent

PGRECT

Code Example

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

int main(int argc, char *argv[])
{
   float x1 = -0.5, x2 = +0.5;			/* Rectangle coordinates */
   float y1 = -0.2, y2 = +0.2;
   float z1 = -0.3, z2 = +0.3;

   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_YELLOW);
   s2rectyz(y1,y2, z1,z2, x1);			/* Rectangle in y-z plane */
   s2sci(S2_PG_GREEN);
   s2rectyz(y1,y2, z1,z2, x2);			/* Rectangle in y-z plane */

   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools