Function:ns2verc
From S2PLOT
ns2verc
Draw an arc - vector input.
Prototype
void ns2verc(XYZ P, XYZ N, XYZ S, float deg, int nseg, float axratio);
Description
Draw an arc with specified major/minor axis ratio. The major axis is given by the starting vector.
See Also
ns2erc | Draw an arc. |
ns2arc | Draw an arc at (px,py,pz) with normal (nx,ny,nz) in current pen (thickness,colour).. |
ns2varc | Draw an arc at (px,py,pz) with normal (nx,ny,nz) in current pen (thickness,colour) - vector input. |
s2line | Draw a poly line, n vertices at (xpts, ypts, zpts). |
Code Example
#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
XYZ pos; /* Position */
XYZ normal; /* Normal */
XYZ start; /* Starting vector */
float deg = 180.0; /* Angular extent */
int nseg = 48; /* Number of segments */
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 */
pos.x = 0.0; pos.y = 0.0; pos.z = 0.0; /* Set position */
normal.x = 0.0; normal.y = 1.0; normal.z = 1.0; /* Normal vector */
start.x = 1.0; start.y = 0.0; start.z = 0.0; /* Normal vector */
s2slw(3); /* Set line width */
s2sci(S2_PG_YELLOW); /* Set the colour */
float axratio = 2.0;
ns2verc(pos, normal, start, deg, nseg, axratio); /* Draw the arc */
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.