/* CREATE MATRICES FOR ROTATING OBJECTS (OF ANY DIMENSION) IN ANY DIMENSION */ #include #include #define SIZE 200 #define TRUE 1 #define FALS 0 main() { int i,j,k,n,c,r,u; int KILL,MATS,NUM,TOP; static char matr [10][6][6][SIZE]; /* Note: Array size and data set here is designed for use in 4-d matrices */ static char data [10][ 5] = {"tz","ty","tx","zy","zx","yx"}; static char pers [10][ 5] = {" "," ","P1","P2","P3","P4","P5","P6"}; static char tess [ 6] [6][SIZE]; static char temp [SIZE]; char *p,*q,*s,*t,*s1,*t1; printf ("This program creates matrices for multidimensional rotations\n"); printf ("This program is presently set for four dimensions\n");n=4; /* Prepare array space for matrices */ KILL = n-2; /* KILLer matrices remove higher dimensionality from end matrix, redundant for display */ MATS = (n-1)*n/2; /* MATriceS needed which when multiplied together will form final matrix */ NUM = MATS+KILL; /* NUMber of arrays needed by the program to preform the manipulations */ TOP = n+1; /* TOP spatial size needed */ printf ("Number of Matrices = %d\n",MATS); printf ("Number of kills = %d\n",KILL); printf ("Total Matrices = %d\n",NUM ); /* THE MATRIX ARRAYS */ printf ("Initializing Matrices\n"); /* Initialization of matrices */ for (i=0;i=s && t1<=s1); /* Look for '+' signs in eqn. and bracket if multiplied */ if (strlen(temp)>1) strcat(temp,"+"); if (*p==' '){strcat(temp,q);goto SKIP;}; if (*q==' '){strcat(temp,p);goto SKIP;}; if (u==TRUE)strcat(temp,"("); strcat(temp,p); if (u==TRUE)strcat(temp,")"); strcat(temp,q); SKIP: ; /* Manx needs null statement at label */ } } strcpy (tess [c][r],temp); if (r