1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| #include<iostream>
#include<string>
#include"points.h"
using namespace std;
int main(int argc,char *argv[])
{
int choix=NULL;
cout<<"A partir quel systeme ? \n1:carthesien \n2:cylindrique \n3:spherique"<<endl;
cin>>choix;
string coords[3];
coords[0]="X Y Z";
coords[1]="r Theta Z";
coords[2]="r Theta Phi";
double inco[3];
cout<<endl<<"Entrez les coordonnées "<<coords[choix-1]<<endl;
for(int i=0;i<3;i++)
cin>>inco[i];
switch(choix)
{
case 1:
{Carth point1(inco[0],inco[1],inco[2]);}
break;
case 2:
{Cylin point1(inco[0],inco[1],inco[2]);}
break;
case 3:
{Spher point1(inco[0],inco[1],inco[2]);}
break;
}
cout<<endl<<"Transformer en quel systeme ? \n1:carthesien \n2:cylindrique \n3:spherique"<<endl;
cin>>choix;
switch(choix)
{
case 1:
{Carth point2(inco[0],inco[1],inco[2]);}
break;
case 2:
{Cylin point2(inco[0],inco[1],inco[2]);}
break;
case 3:
{Spher point2(inco[0],inco[1],inco[2]);}
break;
}
point2(point1);
cout<<endl<<coords[choix-1]<<endl;
for(int i=1;i<4;i++)
{
cout<<point2.GetCoord(i)<<" ";
}
system("PAUSE");
return EXIT_SUCCESS;
} |
Partager