Function:s2rectxy

From S2PLOT

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

s2rectxy

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

Prototype

void s2rectxy(float xmin, float xmax, float ymin, float ymax, float z);

Description

Draw a rectangle in the xy plane, at a given z 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

s2rectxz Draw a rectangle in the xz plane at a given y coordinate.
s2rectyz Draw a rectangle in the yz plane at a given x 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);
   s2rectxy(x1,x2, y1,y2, z1);			/* Rectangle in x-y plane */
   s2sci(S2_PG_GREEN);
   s2rectxy(x1,x2, y1,y2, z2);			/* Rectangle in x-y plane */

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

Back to S2PLOT function list.


Personal tools