Function:ns2vsphere

From S2PLOT

Jump to: navigation, search

ns2vsphere

Draw a sphere, with a given centre, radius and colour - vecotr input.

Prototype

void ns2vsphere(XYZ P, float r, COLOUR col);

Description

Draw a sphere, with a given centre (P), radius (r) and RGB colour (col), using vector data structures.

See Also

ns2sphere Draw a sphere, with a given centre, radius and colour.
struct_COLOUR Data structure for (r,g,b) colour indices.
struct_XYZ Data structure for (x,y,z) coordinates.


Code Example

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

int main(int argc, char *argv[])
{
   float radius = 0.5;				/* Radius of sphere */
   XYZ xyz = { 0.0, 0.0, 0.0 };
   COLOUR colour = { 1.0, 1.0, 0.0 };		/* Yellow */
   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 */

   ns2vsphere(xyz, radius, colour); 		/* A yellow sphere */
   s2show(1);					/* Open the s2plot window */
   
   return 1;
}

Back to S2PLOT function list.


Personal tools