#include "stdio.h" #include "stdlib.h" #include "math.h" #include "string.h" #define WIDTH 600 #define HEIGHT 600 #define NMORPH 100 #define NSPLIT 7 #define ZSCALE 0.5 #define MAXLINE 100 #define MAXPOLY 100 #define PI 3.141592653589793238462643 #define TWOPI 6.283185307179586476925287 #define ABS(x) (x < 0 ? -(x) : (x)) #define MIN(x,y) (x < y ? x : y) #define MAX(x,y) (x > y ? x : y) #define CONST1 0.5 #define CONST2 0.1 #define CONST3 1.0 typedef struct { double x,y,z; } XYZ; typedef struct { double x,y; } POINT2D; typedef struct { POINT2D p1,p2; } LINE2D; typedef struct { double r,g,b; } COLOUR; void WriteStructure(POINT2D *,int,LINE2D *,int,char *); int CreateGrid(XYZ ***,int); int FreeGrid(XYZ ***,int); int InsidePolygon(POINT2D *,int,POINT2D); void WriteGeomGrid(XYZ **,int,char *,double,double); void CopyGrid(XYZ **,XYZ **,int); void CalcZBounds(XYZ **,int,double *,double *); void WritePovray(XYZ **,int,char *,double,double); void CalcUVX(POINT2D,POINT2D,POINT2D,POINT2D,POINT2D,POINT2D *); double LineDist(POINT2D,POINT2D,POINT2D); double LineLength(POINT2D,POINT2D); void ReportRange(XYZ **,int); COLOUR GetColour(double,double,double); double Angle2D(double,double,double,double);