2、ints[i].x,&points[i].y,&points[i].X,&points"].匕&points[i].Z);}fclose(file);file=NULL;returnGCP_Num;}++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++另一个类头文件doubleresult[6];double*R=result;必须声明全局数组、变量另外一个类voidCMatchPlatDoc
3、::OnRection()CResectionrest;FILE*filel=NULL;filel=fopen(,,E:\H.txt,,/“rt”);intm=0;fscanf(filel,"%d",&m);doublef=0;fscanf(filel,“%lf“,&f);〃获取f,m值doubleXso,Yso,Zso;doubleda_0=0,db_O=0,dc_0=0;intgcp_num=rest.Read_xy_XYZ_Points();〃外方位初始值Xso=(rest.points[0].X+rest.points[l]
4、.X+rest.points[2].X+rest.points[3].X)/4;Yso=(rest.points[0].Y+rest.points[l].Y+rest.points[2].Y+rest.points[3].Y)/4;Zso=m*f;〃第一次迭代doubleiteration[6];double*I=iteration;I=JiSuanGuoCheng(Xso,Yso,Zso,da_0,db_O,dc_0);while(l[0]>0.000001
5、
6、l[l]>0.00000111l[2]>0.00000111l[3]>2
7、.90888208656e-511I[4]>2.90888208656e-5
8、
9、l[5]>2.90888208656e-5){Xso=Xso+l[0];Yso=Yso+l[l];Zso=Zso+l[2];da_0=0.0+l[3];db_0=0.0+l[4];dc_0=0.0+l[5];I=JiSuanGuoCheng(Xso,Yso,Zso,da_0,db_O,dc_0);}CStringstr;str.Format("%lf%lf%lf%lf%lf%lf",Xso,Yso,Zso,da_0,db_Ozdc_
10、0);MessageBox(NULL,str,"外方位元素”,MB_OK);}double*CMatchPlatDoc::JiSuanGuoCheng(doubledX,doubled^doubledZ,doubleda,doubledb,doubledc)〃返回外方位元素改正数{CResectionrestl;FILE*filel=NULL;filel=fopen(,,E:\H.txt"/"rt");intm=0;fscanf(filel,"%d",&m);doublef=0;fscanfffilel,”%l化&f);〃获取f,m
11、值〃旋转矩阵初始值已在上血主函数内给出doubleal,a2,a3,bl,b2,b3,cl,c2,c3;al=cos(da)*cos(dc)-sin(da)*sin(db)*sin(dc);a2=-cos(da)*sin(dc)-sin(da)*sin(db)*cos(dc);a3=-sin(da)*cos(db);bl=cos(db)*sin(dc);b2=cos(db)*cos(dc);b3=-sin(db);cl=sin(da)*cos(dc)+cos(da)*sin(db)*sin(dc);c2=-sin(da)*sin(dc
12、)+cos(da)*sin(db)*cos(dc);c3=cos(da)*cos(db);intGCP_Num=restl.Read_xy_XYZ_Points();structJinSidoublex,y;};stru