欢迎来到天天文库
浏览记录
ID:28025485
大小:212.50 KB
页数:14页
时间:2018-12-07
《单像空间后方交会程序报告》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、单像空间后方交会程序报告指导老师:刘老师班级:测绘101姓名:尚锋学号:19号1、应用程序的主入口部分的代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Windows.Forms;namespace单像空间后方交会{staticclassProgram{//////应用程序的主入口点。///[STAThread]staticvoidMain(){Application.Enable
2、VisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(newForm1());}}}2、方法解算类(通用)部分的代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespace单像空间后方交会{classTongyong{structimage_point//一个像点结构,包含像点坐标和地面点坐
3、标{publicdoublex;publicdoubley;publicdoubleX;publicdoubleY;publicdoubleZ;}privatedoublef;//主距privatedoubleu;//u为外方位元素,下面5个相同privatedoublew;privatedoublek;privatedoubleXs;privatedoubleYs;privatedoubleZs;privateimage_point[]p=newimage_point[4];//四个控制点privatedouble[]
4、R=newdouble[9];//旋转矩阵privatedouble[]a=newdouble[8];//像点坐标近似值privatedouble[,]A=newdouble[8,6];//误差方程式系数privatedouble[]L=newdouble[8];//误差方程式常数项privateintcount=0;//统计代次数publicTongyong(doubleg,double[]q)//构造函数,初始化各变量,单位m{f=g;for(inti=0;i<4;i++){intj=i*5;p[i].x=q[j];
5、p[i].y=q[j+1];p[i].X=q[j+2];p[i].Y=q[j+3];p[i].Z=q[j+4];}doubleave=0,sum=0;//求比例尺分母for(inti=0;i<3;i++){for(intj=i+1;j<4;j++){sum+=Math.Sqrt(Math.Pow(p[i].X-p[j].X,2)+Math.Pow(p[i].Y-p[j].Y,2))/Math.Sqrt(Math.Pow(p[i].x-p[j].x,2)+Math.Pow(p[i].y-p[j].y,2));}}ave=s
6、um/6;u=0;//给定外方位元素的初始值,角度均设置为0w=0;k=0;Xs=(p[0].X+p[1].X+p[2].X+p[3].X)/4;//Xs为四个控制点X的平均值,Ys类似Ys=(p[0].Y+p[1].Y+p[2].Y+p[3].Y)/4;Zs=(p[0].Z+p[1].Z+p[2].Z+p[3].Z)/4+ave*f;}privatedoublesin(doublem)//正弦,为简化而写,下同{returnMath.Sin(m);}privatedoublecos(doublem){returnMat
7、h.Cos(m);}privatevoidcalcos()//计算旋转矩阵{R[0]=cos(u)*cos(k)-sin(u)*sin(w)*sin(k);R[1]=-cos(u)*sin(k)-sin(u)*sin(w)*cos(k);R[2]=-sin(u)*cos(w);R[3]=cos(w)*sin(k);R[4]=cos(w)*cos(k);R[5]=-sin(w);R[6]=sin(u)*cos(k)+cos(u)*sin(w)*sin(k);R[7]=cos(u)*sin(w)*cos(k)-sin(u)*
8、sin(k);R[8]=cos(u)*cos(w);}privatevoidcalabout()//像点坐标的近似值{inti;for(i=0;i<4;i++){a[2*i]=-f*(R[0]*(p[i].X-Xs)+R[3]*(p[i].Y-Ys)+R[6]*(p[i].Z-Zs))/(R[2]*(p[i].X-X
此文档下载收益归作者所有