Function:s2arro

From S2PLOT

Revision as of 22:59, 28 October 2007; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

s2arro

Draw an arrow from the point with world-coordinates (x1,y1,z1) to (x2,y2,z2).

Prototype

void s2arro(float x1, float y1, float z1,float x2, float y2, float z2);

Description

Draw an arrow from the point with world-coordinates (x1,y1,z1) to (x2,y2,z2). The size of the arrowhead at (x2,y2,z2) is controlled by the current character size (s2sch). The arrow style is set with s2sah.

See Also

s2sch Set the character height in "arbitrary" units.
s2sah Set the style to be used for arrowheads drawn with s2arro.

PGPLOT Equivalent

PGARRO

Code Example

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

int main(int argc, char *argv[])
{
   float x1 = -0.3, x2 = +0.5;			/* Arrow coordinates */
   float y1 = +0.2, y2 = +0.1;
   float z1 = -0.4, z2 = +0.8;
   int fs = 1;					/* Arrow fill style */
   float angle = 30.0;				/* Arrow cone head angle */
   float barb = 0.7;				/* Arrow barb level */

   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);
   s2sah(fs, angle, barb);			/* Set arrow head style */
   s2sch(5);					/* Set size of arrow head */
   s2arro(x1,y1,z1, x2,y2,z2);			/* Draw an arrow */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools