Function:s2sah
From S2PLOT
(Difference between revisions)
Revision as of 08:39, 27 October 2007 60.230.35.85 (Talk) ← Previous diff |
Current revision S2plot admin (Talk | contribs) |
||
Line 18: | Line 18: | ||
== See Also == | == See Also == | ||
<table> | <table> | ||
+ | <tr><td>[[Function:s2qah | s2qah]]</td><td>Query the arrow-head style.</td></tr> | ||
<tr><td>[[Function:s2arro | s2arro ]]</td><td>Draw an arrow from the point with world-coordinates (x1,y1,z1) to (x2,y2,z2). </td></tr> | <tr><td>[[Function:s2arro | s2arro ]]</td><td>Draw an arrow from the point with world-coordinates (x1,y1,z1) to (x2,y2,z2). </td></tr> | ||
</table> | </table> |
Current revision
s2sah
Set the style to be used for arrowheads drawn with s2arro.
Prototype
void s2sah(int fs, float angle, float barb);
Description
Set the style to be used for arrowheads drawn with s2arro. Currently, all arrowheads are drawn as cones, with the rendering mode (wireframe or shaded) affecting the look. Line-based arrowheads may be added at a later stage. Argument fs is the fill style: fs = 1: filled fs = 2: outline [not yet implemented] Argument angle [5.0, 135.0] is the angle of the arrow point in degrees, with default value 45.0 (a cone of semi-vertex angle 22.5 degrees). Argument barb [0.05, 1.0] is the fraction of the cone that is cut away from the back, such that 0.05 gives an open cone and 1.0 gives a cone with a solid base, with default value 0.3.
See Also
s2qah | Query the arrow-head style. |
s2arro | Draw an arrow from the point with world-coordinates (x1,y1,z1) to (x2,y2,z2). |
PGPLOT Equivalent
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.