0

Hi, i really don't know what to do guys can you help me with this code for my matrix program? this program is not yet finished and i am stuck with this problem

```
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int rotx, roty, rotz, n, ac1, ac2, ac3, ac4, atransx, atransy, atransz;
double axx1, ayx1, azx1, axy1, ayy1, azy1, axz1, ayz1, azz1;
int transx=0;
int transy=0;
int transz=0;
int c1=0;
int c2=0;
int c3=0;
int c4=1;
int counter;
int count=0;
char command;
Start:
float xx1 = 0;
float yx1 = 0;
float zx1 = 0;
float xy1 = 0;
float yy1 = 0;
float zy1 = 0;
float xz1 = 0;
float yz1 = 0;
float zz1 = 0;
cout<<"Choose a command (Maximum of 3 Operations):"<<endl;
cout<<"[1] Rotate X"<<endl<<"[2] Rotate Y"<<endl<<"[3] Rotate Z"<<endl<<"[4] Add Transformation"<<endl<<"[6] Calculate"<<endl<<"[7] Quit"<<endl<<"Choice: ";
cin>>n;
switch (n){
case 1:
cout <<"Rotate X at angle: "<<endl;
cin >> rotx;
xx1 = sin (rotx*3.14/180);
yx1 = cos (rotx*3.14/180);
zx1 = cos (rotx*3.14/180);
xy1 = cos (rotx*3.14/180);
yy1 = cos (rotx*3.14/180);
zy1 = sin (rotx*3.14/180);
xz1 = cos (rotx*3.14/180);
yz1 = -sin (rotx*3.14/180);
zz1 = cos (rotx*3.14/180);
count=count+1;
cout<<"Angle included"<<endl<<endl;
goto Input;
break;
case 2:
cout<<"Rotate Y at angle: "<<endl;
cin >> roty;
xx1 = cos (roty*3.14/180);
yx1 = cos (roty*3.14/180);
zx1 = -sin (roty*3.14/180);
xy1 = cos (roty*3.14/180);
yy1 = sin (roty*3.14/180);
zy1 = cos (roty*3.14/180);
xz1 = sin (roty*3.14/180);
yz1 = cos (roty*3.14/180);
zz1 = cos (roty*3.14/180);
count++;
cout<<"Angle included"<<endl<<endl;
goto Input;
break;
case 3:
cout <<"Rotate Z at angle: "<<endl;
cin >> rotz;
xx1 = cos (rotz*3.14/180);
yx1 = sin (rotz*3.14/180);
zx1 = cos (rotz*3.14/180);
xy1 = -sin (rotz*3.14/180);
yy1 = cos (rotz*3.14/180);
zy1 = cos (rotz*3.14/180);
xz1 = cos (rotz*3.14/180);
yz1 = cos (rotz*3.14/180);
zz1 = sin (rotz*3.14/180);
count++;
cout<<"Angle included"<<endl<<endl;
goto Input;
break;
} //end of cases
Input:
if (count==1)
{
axx1=xx1;
ayx1=yx1;
azx1=zx1;
ac1=c1;
axy1=xy1;
ayy1=yy1;
azy1=zy1;
ac2=c2;
axz1=xz1;
ayz1=yz1;
azz1=zz1;
ac3=c3;
atransx=transx;
atransy=transy;
atransz=transz;
ac4=c4;
cout<<"Your Translation is:"<<endl<<endl;
cout<<" "<<axx1<<" "<<axy1<<" "<<axz1<<" "<<atransx<<" "<<endl;
cout<<" "<<ayx1<<" "<<ayy1<<" "<<ayz1<<" "<<atransy<<" "<<endl;
cout<<" "<<azx1<<" "<<azy1<<" "<<azz1<<" "<<atransz<<" "<<endl;
cout<<" "<<ac1<<" "<<ac2<<" "<<ac3<<" "<<ac4<<" "<<endl<<endl<<endl;
goto Start;
}
else
return 0;
}
```

output:

1 0.000796327 0.000796327 0

0.000796327 0.000796327 -1 0

0.000796327 1 0.000796327 0

0 0 0 1

output should be:

1 0 0 0

0 0 -1 0

0 1 0 0

0 0 0 1

any idea how can i have this??? thanks a lot

*Edited 6 Years Ago by lloydi12345*: n/a