声源定位和GPS模拟实验编程_声源定位和gps模拟
声源定位和GPS模拟实验编程由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“声源定位和gps模拟”。
1、声源定位:
#include #include using namespace std;#define c 2982 #define pai 3.1415926535
int main(){ double x0,x1,x2,y0,y1,y2,t0,t1,t2,t3,A,B,D,angle1,angle2,dt1,dt2,r;x0=0,x1=0,x2=0.3;y0=0,y1=0.45,y2=0.45;int i = 8;while(i--){
cout
cin >> t0 >> t1 >> t2>> t3;
t0 = t0 / 1000000;
t1 = t1 / 1000000;
t2 = t2 / 1000000;
dt1 = t0t2;
A = x2*(pow(x1,2)+pow(y1,2)-pow(c*dt1,2))y1*(pow(x2,2)+pow(y2,2)-pow(c*dt2,2));
D = c*dt1*(pow(x2,2)+pow(y2,2)-pow(c*dt2,2))acos(D/sqrt(pow(A,2)+pow(B,2)));
r =(pow(x1,2)+pow(y1,2)-pow(c*dt1,2))/(2*(x1*cos(angle1)+y1*sin(angle1)+c*dt1));
cout
y1 += E;
if((pow(D,2)+pow(E,2))
break;} // end while;x1 = x1*1000;y1 = y1*1000;
cout
int main(){ int yy;double t1[10] , t2[10] , t3[10] , x[10] , y[10];cout
cout
cin >> t1[i] >> t2[i] >> t3[i] >> x[i] >> y[i];} // end for;
GPS(x,y,t1,0,0.45,1);GPS(x,y,t2,0.3,0.45,2);GPS(x,y,t3,0,0,3);cin>>yy;return 0;} // end main;