hMatrix T_hMatrix(double *theta, double *alpha, double *a, double *d, int joint){ double Theta[7], Alpha[7], A[7], D[7]; for(int i=0; i<joint; i++){ Theta[i] = *theta; Alpha[i] = *alpha; A[i] = *a; D[i] = *d; theta++; alpha++; a++; d++; } hMatrix Temp1(4,4), T(4,4); double value[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}; T.SET(4,4,&value[0]); for(int i=0; i<joint; i++){ Temp1 = A_hMatrix(Theta[i],Alpha[i],A[i],D[i]); T = T*Temp1; } return T; }
void Add(void){ char opt; fa=fopen("acc.dat","ab"); clrscr(); Temp1(); gotoxy(19,8); scanf(" "); gets(rec.rno); gotoxy(19,10); scanf(" "); gets(rec.nm); gotoxy(19,12); scanf(" "); gets(rec.snm); gotoxy(19,14); rec.mi=getche(); rec.mi=toupper(record.mi); gotoxy(19,16); rec.ccode=getche(); rec.ccode=toupper(rec.ccode); gotoxy(5,22); clreol(); printxy(79,22,"º"); fprintf(fp,"%s %s %s %c%c",rec.snum,rec.fname,rec.sname,rec.mi,rec.ccode); gotoxy(5,21); clreol(); center(21,"Record successfully added!"); printxy(79,21,"º"); gotoxy(53,22); delay(1000); center(22,"Press any key to go to main menu..."); getch(); fclose(fa); }