} } }
else if(strTmp[0]==\) {
header.UnKnownPointCount =_ttoi(strTmp[1]); header.UnKnownPoint=new
ControlPointData[header.UnKnownPointCount];
if(strTmp!=NULL)//释放内存 {
delete[] strTmp; strTmp=NULL; }
for(int i=0;i sf.ReadString (strLine); strData+=strLine; strData+=_T(\); strTmp = SplitString(strLine, ',',n1); header.UnKnownPoint[i].strID=strTmp[0]; header.UnKnownPoint[i].x1 =_tstof(strTmp[1]); header.UnKnownPoint[i].y1=_tstof(strTmp[2]); header.UnKnownPoint[i].x2 =_tstof(strTmp[3]); header.UnKnownPoint[i].y2 =_tstof(strTmp[4]); header.UnKnownPoint[i].Xtp=0; header.UnKnownPoint[i].Ytp =0; header.UnKnownPoint[i].Ztp=0; if(strTmp!=NULL)//释放内存 { delete[] strTmp; strTmp=NULL; } } } } if(strTmp!=NULL)//释放内存 { delete[] strTmp; strTmp=NULL; } sf.Close();//关闭文件 return true; } const double pi=3.1415926; void Adjustment::adjustment1(CString &OutData)//单片后交 { CMatrix B,L,X; B.SetSize(2*header.StationCount,6);//系数阵 L.SetSize(2*header.StationCount,1);//常数项阵 X.SetSize(6,1);//未知数改正数之和的阵 CMatrix R(3,3),Xb(3,1),bb(3,1);//R为旋转矩阵,Xb为X-Xs,Y-Ys,Z-Zs的矩阵,bb为X-,Y-,Z-的矩阵 CMatrix Dx(6,1),Nbb,Nvv;//Dx为改正数阵 header.photo.m=10000; double Xs0,Ys0,Zs0,φ,ω,κ;//未知数初值 //确定未知数初值 double x=0,y=0,z=0; for(int i=0;i x+=header.StationCoor[i].Xtp; y+=header.StationCoor[i].Ytp; z+=header.StationCoor[i].Ztp; } Xs0=x/header.StationCount; Ys0=y/header.StationCount; Zs0=header.photo.m*header.photo.f/1000; φ=0; ω=0; κ=0; double n=0; //计算左片外方位元素 ***************************************************************// //*********************************************************************************// do { n++; //计算旋转矩阵R double a1,a2,a3,b1,b2,b3,c1,c2,c3; a1=cos(φ)*cos(κ)-sin(φ)*sin(ω)*sin(κ); R(0,0)=a1; a2=-cos(φ)*sin(κ)-sin(φ)*sin(ω)*cos(κ); R(0,1)=a2; a3=-sin(φ)*cos(ω); R(0,2)=a3; b1=cos(ω)*sin(κ); R(1,0)=b1; b2=cos(ω)*cos(κ); R(1,1)=b2; b3=-sin(ω); R(1,2)=b3; c1=sin(φ)*cos(κ)+cos(φ)*sin(ω)*sin(κ); R(2,0)=c1; c2=-sin(φ)*sin(κ)+cos(φ)*sin(ω)*cos(κ); R(2,1)=c2; c3=cos(φ)*cos(ω); R(2,2)=c3; //计算像点坐标的近似值,构建B,L矩阵 for(int i=0; i bb(0,0)=a1*(header.StationCoor[i].Xtp-Xs0)+b1*(header.StationCoor[i].Ytp-Ys0) +c1*(header.StationCoor[i].Ztp-Zs0); bb(1,0)=a2*(header.StationCoor[i].Xtp-Xs0)+b2*(header.StationCoor[i].Ytp-Ys0) //单位为m +c2*(header.StationCoor[i].Ztp-Zs0); bb(2,0)=a3*(header.StationCoor[i].Xtp-Xs0)+b3*(header.StationCoor[i].Ytp-Ys0) +c3*(header.StationCoor[i].Ztp-Zs0); double t1=header.StationCoor[i].x1;//(X-X0)(Y-Y0)的值,单位为mm double t2=header.StationCoor[i].y1; L(2*i,0)=(header.StationCoor[i].x1+header.photo.f*bb(0,0)/bb(2,0))/1000; L(2*i+1,0)=(header.StationCoor[i].y1+header.photo.f*bb(1,0)/bb(2,0))/1000; B(2*i,0)=(a1*header.photo.f+a3*t1)/bb(2,0)/1000; B(2*i,1)=(b1*header.photo.f+b3*t1)/bb(2,0)/1000; B(2*i,2)=(c1*header.photo.f+c3*t1)/bb(2,0)/1000; B(2*i,3)=(t2*sin(ω)-(t1/header.photo.f*(t1*cos(κ)-t2*sin(κ))+header.photo.f*cos(κ))*cos(ω))/1000; B(2*i,4)=(-header.photo.f*sin(κ)-t1/header.photo.f*(t1*sin(κ)+t2*cos(κ)))/1000; B(2*i,5)=t2/1000; B(2*i+1,0)=(a2*header.photo.f+a3*t2)/bb(2,0)/1000; B(2*i+1,1)=(b2*header.photo.f+b3*t2)/bb(2,0)/1000; B(2*i+1,2)=(c2*header.photo.f+c3*t2)/bb(2,0)/1000; B(2*i+1,3)=(-t1*sin(ω)-(t2/header.photo.f*(t1*cos(κ)-t2*sin(κ))-header.photo.f*sin(κ))*cos(ω))/1000; B(2*i+1,4)=(-header.photo.f*cos(κ)-t2/header.photo.f*(t1*sin(κ)+t2*cos(κ)))/1000; B(2*i+1,5)=-t1/1000; } //平差计算 Nbb=(~B)*B; Nvv=(~B)*L; Dx=(Nbb.Inv())*Nvv; Xs0+=Dx(0,0);Ys0+=Dx(1,0);Zs0+=Dx(2,0); φ+=Dx(3,0);ω+=Dx(4,0);κ+=Dx(5,0); }while((fabs(Dx(0,0))>0.001)||(fabs(Dx(1,0))>0.001)||(fabs(Dx(2,0))>0.001)||(fabs(Dx(3,0)*206265)>1)|| (fabs(Dx(4,0)*206265)>1)||(fabs(Dx(5,0)*206265)>1)); header.photo.Xs1=Xs0; header.photo.Ys1=Ys0; header.photo.Zs1=Zs0; header.photo.φ=φ; header.photo.ω=ω; header.photo.κ=κ; CMatrix V=B*Dx-L; CMatrix Vt=(~V)*V;//改正数转置 double m0=sqrt(Vt(0,0)/(2*header.StationCount-6)); CMatrix Q=Nbb.Inv();//协因数阵 //求解点位误差 header.photo.σXs1=sqrt(Q(0,0))*m0; header.photo.σYs1=sqrt(Q(1,1))*m0; header.photo.σZs1=sqrt(Q(2,2))*m0; header.photo.σφ=sqrt(Q(3,3))*m0; header.photo.σω=sqrt(Q(4,4))*m0; header.photo.σκ=sqrt(Q(5,5))*m0; CString data; data.Format(_T(\),_T(\后方交会成果\)); OutData+=data; OutData+=\; data.Format(_T(\),_T(\左片\),_T(\迭代次数\),n); OutData+=data; OutData+=(\); data.Format(_T(\%s %s %s %s\\r\\n\), _T(\左片外方位元素(线元素为m,角元素为度)\), _T(\),_T(\),_T(\),_T(\φ\),_T(\ω\),_T(\κ\)); OutData+=data; data.Format(_T(\ %.4f\\r\\n\\r\\n\), header.photo.Xs1,header.photo.Ys1,header.photo.Zs1,header.photo.φ*180/pai, header.photo.ω*180/pai,header.photo.κ*180/pai); OutData+=data; data.Format(_T(\ %s %s %s %s\\r\\n\), _T(\左片精度(线元素精度为m,角元素精度为″)\),_T(\单位权中误差 m0\),m0,_T(\σXs\),_T(\σYs\),_T(\σZs\),_T(\σφ\),_T(\σω\),_T(\σκ\)); OutData+=data; data.Format(_T(\ %.4f\\r\\n\), header.photo.σXs1,header.photo.σYs1,header.photo.σZs1, header.photo.σφ*180/pai*3600,header.photo.σω*206265,header.photo.σκ*206265); OutData+=data; OutData+=(\); //计算右片外方位元素 ****************************************************************// //************************************************************************************// Xs0=x/header.StationCount; Ys0=y/header.StationCount; Zs0=header.photo.m*header.photo.f/1000; φ=0; ω=0; κ=0; n=0; do { n++; //计算旋转矩阵R double a1,a2,a3,b1,b2,b3,c1,c2,c3; a1=cos(φ)*cos(κ)-sin(φ)*sin(ω)*sin(κ); R(0,0)=a1; a2=-cos(φ)*sin(κ)-sin(φ)*sin(ω)*cos(κ); R(0,1)=a2; a3=-sin(φ)*cos(ω); R(0,2)=a3; b1=cos(ω)*sin(κ); R(1,0)=b1; b2=cos(ω)*cos(κ); R(1,1)=b2; b3=-sin(ω); R(1,2)=b3; c1=sin(φ)*cos(κ)+cos(φ)*sin(ω)*sin(κ); R(2,0)=c1; c2=-sin(φ)*sin(κ)+cos(φ)*sin(ω)*cos(κ); R(2,1)=c2; c3=cos(φ)*cos(ω); R(2,2)=c3; 搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新经管营销摄影测量学空间后交-前交实验报告 (3)全文阅读和word下载服务。
相关推荐: