Simple program to define a surface.

This commit is contained in:
Ernie Pasveer
2022-06-03 15:51:28 -05:00
parent 03cb4f4f05
commit 091a38caa8
4 changed files with 55 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <string.h>
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <iostream>
int main (void) {
float xyz[] = {
0.0, 0.0, 3.0,
1.0, 4.0, 0.0,
0.0, 1.0, 0.0,
4.0, 0.0, 3.0,
1.0, 4.0, 7.0,
0.0, 6.0, 0.0
};
int npoints = sizeof(xyz) / (3 * sizeof(float));
printf("Hello surface!\n");
printf("# points = %d\n", npoints);
for (int i=0,j=0; i<npoints; i++) {
printf ("%3.1f %3.1f %3.1f\n", xyz[j], xyz[j+1], xyz[j+2]);
j += 3;
}
return 0;
}