Guruh Ahmadaliyev Muhammad Ali
Download 126.44 Kb.
|
KompGrafikaMusIsh1
219-21-guruh Ahmadaliyev Muhammad Ali #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R=100,dB=5,dL=5,alfa=90,beta=90,k=500,t=1000; // cout<<"R="; //cin>>R; //cout<<"dB="; // cin>>dB; // cout<<"dL="; // cin>>dL; //cout<<"alfa="; // cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; // cin>>k; //cout<<"Tekislik="; //cin>>t; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180); y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180); z[0]=2*R*sin(B*M_PI/180); dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=2*R*sin((B+dB)*M_PI/180); dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180); y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180); z[2]=2*R*sin((B+dB)*M_PI/180); dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180); z[3]=2*R*sin(B*M_PI/180); dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R=200,dB=5,dL=5,alfa=90,beta=90,k=500,t=1000; // cout<<"R="; //cin>>R; //cout<<"dB="; // cin>>dB; // cout<<"dL="; // cin>>dL; //cout<<"alfa="; // cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; // cin>>k; //cout<<"Tekislik="; //cin>>t; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180); y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180); z[0]=0.5*R*sin(B*M_PI/180); dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=0.5*R*sin((B+dB)*M_PI/180); dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180); y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180); z[2]=0.5*R*sin((B+dB)*M_PI/180); dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180); z[3]=0.5*R*sin(B*M_PI/180); dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R=200,dB=5,dL=5,alfa=90,beta=90,k=700,t=1000; // cout<<"R="; //cin>>R; //cout<<"dB="; // cin>>dB; // cout<<"dL="; //cin>>dL; //cout<<"alfa="; //cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; //cin>>k; //cout<<"Tekislik="; //cin>>t; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180); y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180); z[0]=R*sin(B*M_PI/180); if(z[0]<=0){ z[0]*=2; } dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=R*sin((B+dB)*M_PI/180); if(z[1]<=0){ z[1]*=2; } dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180); y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180); z[2]=R*sin((B+dB)*M_PI/180); if(z[2]<=0){ z[2]*=2; } dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180); z[3]=R*sin(B*M_PI/180); if(z[3]<=0){ z[3]*=2; } dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R=200,dB=5,dL=5,alfa=90,beta=100,k=700,t=1000; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180); y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180); z[0]=R*sin(B*M_PI/180); if(z[0]<=0){ z[0]=R-0.5*z[0]; } dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=R*sin((B+dB)*M_PI/180); if(z[1]<=0){ z[1]=R-0.3*z[1]; } dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180); y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180); z[2]=R*sin((B+dB)*M_PI/180); if(z[2]<=0){ z[2]=R-0.5*z[2]; } dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180); z[3]=R*sin(B*M_PI/180); if(z[3]<=0){ z[3]=R-0.5*z[3]; } dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R=200,dB=5,dL=5,alfa=90,beta=90,k=700,t=1000; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180); y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180); z[0]=R*sin(B*M_PI/180); if(z[0]>0){ z[0]+=R; } dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=R*sin((B+dB)*M_PI/180); if(z[1]>0){ z[1]+=R; } dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180); y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180); z[2]=R*sin((B+dB)*M_PI/180); if(z[2]>0){ z[2]+=R; } dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180); z[3]=R*sin(B*M_PI/180); if(z[3]>0){ z[3]+=R; } dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; //cout<<"R="; //cin>>R; //cout<<"dB="; //cin>>dB; //cout<<"dL="; //cin>>dL; //cout<<"alfa="; //cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; //cin>>k; //cout<<"Tekislik="; //cin>>t; R = 100; dB=5; dL=5; alfa =90; beta= 270; k=500; t = 1000; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { double chIf = 2.5*R*pow(R*sin(B*M_PI/180)/R-0.5,2); x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180) ; y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180) ; z[0]=R*sin(B*M_PI/180); if(z[0]>=R/2){ z[0]+=chIf; } dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); chIf = 2.5*R*pow(R*sin((B+dB)*M_PI/180)/R-0.5,2); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=R*sin((B+dB)*M_PI/180); if(z[1]>=R/2){ z[1]+=chIf; } dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); chIf = 2.5*R*pow(R*sin((B+dB)*M_PI/180)/R-0.5,2); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180) ; y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180) ; z[2]=R*sin((B+dB)*M_PI/180); if(z[2]>=R/2){ z[2]+=chIf; } dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); chIf = 2.5*R*pow(R*sin(B*M_PI/180)/R-0.5,2); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180) ; z[3]=R*sin(B*M_PI/180) ; if(z[3]>=R/2){ z[3]+=chIf; } dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R=200,dB=5,dL=5,alfa=90,beta=270,k=700,t=1000; initwindow(600,600); for(B=-90;B<90;B+=dB) for(L=0;L<=360;L+=dL) { x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180); y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180); z[0]=R*sin(B*M_PI/180); if((B*M_PI/180)>0){ z[0]=z[0]+R*pow((B*M_PI/180)/((M_PI/180)*90),4); } dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=R*sin((B+dB)*M_PI/180); if((B*M_PI/180)>0){ z[1]=z[1]+R*pow(((B+dB)*M_PI/180)/((M_PI/180)*90),4); } dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180); y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180); z[2]=R*sin((B+dB)*M_PI/180); if((B*M_PI/180)>0){ z[2]=z[2]+R*pow(((B+dB)*M_PI/180)/((M_PI/180)*90),4); } dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180); z[3]=R*sin(B*M_PI/180); if((B*M_PI/180)>0){ z[3]=z[3]+R*pow((B*M_PI/180)/((M_PI/180)*90),4); } dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R=200,dB=5,dL=5,alfa=90,beta=330,k=500,t=1000; initwindow(600,600); for(B=-90;B<90;B+=dB) for(L=0;L<=360;L+=dL) { x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180); y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180); z[0]=R*sin(B*M_PI/180); z[0]=z[0]-R*pow((B*M_PI/180)/((M_PI/180)*90),3); dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180); y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=R*sin((B+dB)*M_PI/180); z[1]=z[1]-R*pow(((B+dB)*M_PI/180)/((M_PI/180)*90),3); dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180); y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180); z[2]=R*sin((B+dB)*M_PI/180); z[2]=z[2]-R*pow(((B+dB)*M_PI/180)/((M_PI/180)*90),3); dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180); y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180); z[3]=R*sin(B*M_PI/180); z[3]=z[3]-R*pow((B*M_PI/180)/((M_PI/180)*90),3); dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; R = 70; dB=5; dL=5; alfa =180; beta= 90; k=500; t = 1000; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { double chIf = pow(R*sin(B*M_PI/180),2)/(R); x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180) +chIf; y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180) ; z[0]=2*R*sin(B*M_PI/180); dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); chIf = pow(R*sin((B+dB)*M_PI/180),2)/(R); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180)+chIf; y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=2*R*sin((B+dB)*M_PI/180); dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); chIf = pow(R*sin((B+dB)*M_PI/180),2)/(R); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180)+chIf ; y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180) ; z[2]=2*R*sin((B+dB)*M_PI/180); dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); chIf = pow(R*sin(B*M_PI/180),2)/(R); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180)+ chIf; y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180) ; z[3]=2*R*sin(B*M_PI/180); dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; //cout<<"R="; //cin>>R; //cout<<"dB="; //cin>>dB; //cout<<"dL="; //cin>>dL; //cout<<"alfa="; //cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; //cin>>k; //cout<<"Tekislik="; //cin>>t; R = 70; dB=5; dL=5; alfa =0; beta= 90; k=500; t = 1000; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { double chIf = pow(R*sin(B*M_PI/180),3)/(R*R); x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180) +chIf; y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180) ; z[0]=2*R*sin(B*M_PI/180); dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); chIf = pow(R*sin((B+dB)*M_PI/180),3)/(R*R); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180)+chIf; y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=2*R*sin((B+dB)*M_PI/180); dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); chIf = pow(R*sin((B+dB)*M_PI/180),3)/(R*R); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180)+chIf ; y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180) ; z[2]=2*R*sin((B+dB)*M_PI/180); dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); chIf = pow(R*sin(B*M_PI/180),3)/(R*R); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180)+ chIf; y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180) ; z[3]=2*R*sin(B*M_PI/180); dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; //cout<<"R="; //cin>>R; //cout<<"dB="; //cin>>dB; //cout<<"dL="; //cin>>dL; //cout<<"alfa="; //cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; //cin>>k; //cout<<"Tekislik="; //cin>>t; R = 70; dB=5; dL=5; alfa =180; beta= 90; k=500; t = 1000; initwindow(600,600); for(B=-90;B<90;B+=dB) for(L=0;L<=360;L+=dL) { double chIf = R*pow((B*M_PI/180)/(45*M_PI/180),2); x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180) +chIf; y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180) ; z[0]=2*R*sin(B*M_PI/180); dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); chIf = R*pow(((B+dB)*M_PI/180)/(45*M_PI/180),2); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180)+chIf; y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180); z[1]=2*R*sin((B+dB)*M_PI/180); dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); chIf = R*pow(((B+dB)*M_PI/180)/(45*M_PI/180),2); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180)+chIf ; y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180) ; z[2]=2*R*sin((B+dB)*M_PI/180); dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); chIf = R*pow((B*M_PI/180)/(45.0*M_PI/180),2); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180)+ chIf; y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180) ; z[3]=2*R*sin(B*M_PI/180); dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; //cout<<"R="; //cin>>R; //cout<<"dB="; //cin>>dB; //cout<<"dL="; //cin>>dL; //cout<<"alfa="; //cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; //cin>>k; //cout<<"Tekislik="; //cin>>t; R = 100; dB=5; dL=5; alfa =110; beta= 200; k=500; t = 1000; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { double ch =(1+0.5*abs(sin(2*L*M_PI/180))); double chIf = R*pow(((B/90)*M_PI/180),5); x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180)* ch; y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180)* ch; z[0]=R*sin(B*M_PI/180); dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); ch =(1+0.5*abs(sin(2*L*M_PI/180))); chIf = R*pow(((B+dB)/90)*M_PI/180,5); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180)*ch; y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180)*ch; z[1]=R*sin((B+dB)*M_PI/180); dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); ch =(1+0.5*abs(sin(2*(L+dL)*M_PI/180))); chIf = R*pow(((B+dB)/90)*M_PI/180,5); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180)*ch; y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180)*ch; z[2]=R*sin((B+dB)*M_PI/180); dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); ch =(1+0.5*abs(sin(2*(L+dL)*M_PI/180))); chIf = R*pow(((B)/90)*M_PI/180,5); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180)*ch; y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180)*ch; z[3]=R*sin(B*M_PI/180); dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } #include #include #include using namespace std; int main() { double R,dB,dL,L,B,alfa,beta,k,t,x[10],y[10],z[10],dx[10],dy[10],dz[10],X[10],Y[10],Z[10]; //cout<<"R="; //cin>>R; //cout<<"dB="; //cin>>dB; //cout<<"dL="; //cin>>dL; //cout<<"alfa="; //cin>>alfa; //cout<<"beta="; //cin>>beta; //cout<<"Kamera="; //cin>>k; //cout<<"Tekislik="; //cin>>t; R = 100; dB=5; dL=5; alfa =135; beta= 135; k=500; t = 1000; double ch; double chIf; initwindow(600,600); for(B=-90;B<=90;B+=dB) for(L=0;L<=360;L+=dL) { ch =(1+0.5*abs(sin(2*L*M_PI/180))); chIf = R*pow((B*M_PI/180)/(90*M_PI/180),5); x[0]=R*cos(B*M_PI/180)*sin(L*M_PI/180)* ch; y[0]=R*cos(B*M_PI/180)*cos(L*M_PI/180)* ch; z[0]=R*sin(B*M_PI/180)+chIf; if(B*M_PI/180>0) z[0] -= chIf; dx[0]=x[0]*cos(alfa*M_PI/180)-y[0]*sin(alfa*M_PI/180); dy[0]=x[0]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[0]*sin(beta*M_PI/180); dz[0]=x[0]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[0]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[0]*cos(beta*M_PI/180); X[0]=dx[0]*(k-t)/(k-dz[0]); Y[0]=dy[0]*(k-t)/(k-dz[0]); ch =(1+0.5*abs(sin(2*L*M_PI/180))); chIf = R*pow((B+dB)*(M_PI/180)/(90*M_PI/180),5); x[1]=R*cos((B+dB)*M_PI/180)*sin(L*M_PI/180)*ch; y[1]=R*cos((B+dB)*M_PI/180)*cos(L*M_PI/180)*ch; z[1]=R*sin((B+dB)*M_PI/180)+chIf; if((B+dB)*M_PI/180>0) z[1]-=chIf; dx[1]=x[1]*cos(alfa*M_PI/180)-y[1]*sin(alfa*M_PI/180); dy[1]=x[1]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[1]*sin(beta*M_PI/180); dz[1]=x[1]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[1]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[1]*cos(beta*M_PI/180); X[1]=dx[1]*(k-t)/(k-dz[1]); Y[1]=dy[1]*(k-t)/(k-dz[1]); ch =(1+0.5*abs(sin(2*(L+dL)*M_PI/180))); chIf = R*pow(((B+dB)*(M_PI/180))/(90*M_PI/180),5); x[2]=R*cos((B+dB)*M_PI/180)*sin((L+dL)*M_PI/180)*ch; y[2]=R*cos((B+dB)*M_PI/180)*cos((L+dL)*M_PI/180)*ch; z[2]=R*sin((B+dB)*M_PI/180)+chIf; if ((B+dB)*M_PI/180>0) z[2]-=chIf; dx[2]=x[2]*cos(alfa*M_PI/180)-y[2]*sin(alfa*M_PI/180); dy[2]=x[2]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[2]*sin(beta*M_PI/180); dz[2]=x[2]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[2]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[2]*cos(beta*M_PI/180); X[2]=dx[2]*(k-t)/(k-dz[2]); Y[2]=dy[2]*(k-t)/(k-dz[2]); ch =(1+0.5*abs(sin(2*(L+dL)*M_PI/180))); chIf = R*pow((B*M_PI/180)/(90*M_PI/180),5); x[3]=R*cos(B*M_PI/180)*sin((L+dL)*M_PI/180)*ch; y[3]=R*cos(B*M_PI/180)*cos((L+dL)*M_PI/180)*ch; z[3]=R*sin(B*M_PI/180)+chIf; if(B*M_PI/180>0) z[3]-=chIf; dx[3]=x[3]*cos(alfa*M_PI/180)-y[3]*sin(alfa*M_PI/180); dy[3]=x[3]*sin(alfa*M_PI/180)*cos(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*cos(beta*M_PI/180)-z[3]*sin(beta*M_PI/180); dz[3]=x[3]*sin(alfa*M_PI/180)*sin(beta*M_PI/180)+y[3]*cos(alfa*M_PI/180)*sin(beta*M_PI/180)+z[3]*cos(beta*M_PI/180); X[3]=dx[3]*(k-t)/(k-dz[3]); Y[3]=dy[3]*(k-t)/(k-dz[3]); int c[]={X[0]+300,Y[0]+300,X[1]+300,Y[1]+300,X[2]+300,Y[2]+300,X[3]+300,Y[3]+300,X[0]+300,Y[0]+300}; setfillstyle(2,2); fillpoly(5,c); } system("pause"); } Download 126.44 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling