You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<stdio.h>#include<stdlib.h>#include"s2plot.h"intmain(intargc, char*argv[])
{
s2opend("/?",argc, argv); /* Open the display */s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates *//* Draw the coordinate box: character strings give formatting options */s2box("BCDETMNOPQ", 0,0, "BCDETMNOPQ", 0,0, "BDECTMNOPQ", 0,0);
s2lab("X-axis","Y-axis","Z-axis","Plot"); /* Write some labels */s2show(1); /* Open the s2plot window */returnEXIT_SUCCESS;
}
#include<stdio.h>#include<stdlib.h>#include<time.h>#include"s2plot.h"intmain(intargc, char*argv[])
{
srand48((long)time(NULL)); /* Alway seed your RNG! */s2opend("/?",argc, argv); /* Open the display */s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates *//* Draw the coordinate box: character strings give formatting options */s2box("BCDETMNOPQ", 0,0, "BCDETMNOPQ", 0,0, "BDECTMNOPQ", 0,0);
s2lab("X-axis","Y-axis","Z-axis","Plot"); /* Write some labels */intN=1000; /* How many points to plot? */XYZxyz; /* A vector position */COLOURcol; /* An RGB colour */for (inti=0;i<N;i++) {
xyz.x=drand48()*2.0-1.0; /* Random coordinate in [-1..1] */xyz.y=drand48()*2.0-1.0;
xyz.z=drand48()*2.0-1.0;
col.r=drand48(); /* Random colour map in [0..1] */col.g=drand48();
col.b=drand48();
ns2vpoint(xyz, col); /* Plot the point using the colour */
}
s2show(1); /* Open the s2plot window */returnEXIT_SUCCESS;
}
#include<stdio.h>#include<stdlib.h>#include<time.h>#include"s2plot.h"intmain(intargc, char*argv[])
{
srand48((long)time(NULL)); /* Alway seed your RNG! */s2opend("/?",argc, argv); /* Open the display */s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates *//* Draw the coordinate box: character strings give formatting options */s2box("BCDETMNOPQ", 0,0, "BCDETMNOPQ", 0,0, "BDECTMNOPQ", 0,0);
s2lab("X-axis","Y-axis","Z-axis","Plot"); /* Write some labels */intN=1000; /* How many points to plot? */XYZxyz; /* A vector position */COLOURcol; /* An RGB colour */floatradius=0.1; /* Radius of a sphere */ss2ssr(10); /* Set the resolution of the sphere */for (inti=0;i<N;i++) {
xyz.x=drand48()*2.0-1.0; /* Random coordinate in [-1..1] */xyz.y=drand48()*2.0-1.0;
xyz.z=drand48()*2.0-1.0;
col.r=drand48(); /* Random colour map in [0..1] */col.g=drand48();
col.b=drand48();
ns2vsphere(xyz, radius, col); /* Draw a sphere using using the colour */
}
s2show(1); /* Open the s2plot window */returnEXIT_SUCCESS;
}