Function:struct XYZ
From S2PLOT
(Difference between revisions)
Revision as of 04:37, 26 October 2007 S2plot admin (Talk | contribs) ← Previous diff |
Revision as of 04:37, 26 October 2007 S2plot admin (Talk | contribs) Next diff → |
||
Line 17: | Line 17: | ||
== See Also == | == See Also == | ||
<table> | <table> | ||
- | <tr><td>[[Function:struct_COLOUR | struct_COLOUR ]]</td><td>Data structure for (r,g,b) colour indices. </td></tr> | + | <tr><td>[[Function:struct COLOUR | struct COLOUR ]]</td><td>Data structure for (r,g,b) colour indices. </td></tr> |
</table> | </table> | ||
Revision as of 04:37, 26 October 2007
struct XYZ
Data structure for (x,y,z) coordinates.
Definition
typedef struct {
double x, y, z;
} XYZ;
Description
Data structure for storing (x,y,z) coordinates.
See Also
struct COLOUR | Data structure for (r,g,b) colour indices. |
Code Example
#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
XYZ xyz; /* Declare an XYZ variable */
COLOUR col; /* Declare a COLOUR variable */
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 */
xyz.x = 0.0; /* Set some values */
xyz.y = 0.5;
xyz.z = -0.3;
col.r = 0.3; /* Set colour value */
col.g = 1.0;
col.b = 0.7;
ns2vpoint(xyz, col); /* Draw the point */
s2show(1); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.