间接平差基础大作业_第1页
间接平差基础大作业_第2页
间接平差基础大作业_第3页
间接平差基础大作业_第4页
间接平差基础大作业_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、测量平差基础间接平差法报告书姓名: 学号:日期:2016指导老师:目录 TOC o 1-5 h z 1)平差原理22)平差过程3平差流程3平差相关代码33)平差结果(要求以表格形式表达;注意单位统一及有效位数的取位) 254)结论295)课程设计的体会及建议 306) 参考文献311)平差原理设有n个观测值L,必要观测个数为七,选定的独立参数文 近似值取为*。有L=L + V平差值方程为 4 +匕=afX +瓦德+ F区+4L = t J LfJti.l匕=伙匕匕 TOC o 1-5 h z 1K T%.X = X,X、- r1,1 L1d=H小乙1仇 4 厂B =a2b2. P P12* 曲

2、 * a,tbn “ri-ri 1L + V = BX + J4=X。+I = L-(BX” +d)V = Bx-1误差方程要求:V1 PV = min对自变量X求导,令一阶导数为0dVTPV T eV=2V P-f 4% iroxdx= 2VrPf =0Br PV=QV - Bx-1BTPV =0基础方程ri J v Bx-1法方程的解:BTPV =0,BTPBx-fTPl=()法方程x = (Bt PR) RtPlN面二1 PB, w = B Pl 口Nhhx-W=0I pact Uj + pttbix +- + patxt = pal I pabxy +| pbbx2 +* + f?bt

3、xi = pbl 观测值和参数的平差值: = +匕X = Xn+xlpwdi1+1“加氏+1M戊=lpP为对角阵2)平差过程平差流程.读取观测数据与已知点坐标数据(包括一些数据的精度);.计算未知点近似坐标;.建立角度与边长误差方程;.计算角度观测值误差方程的系数和常数项;.计算边长观测值误差方程的系数和常数项;.组成误差方程,得到系数阵和常数阵;.定权,得到权矩阵;.组成并解算法方程;.计算观测值的平差值及其方差协方差阵DLL与坐标平差值(Xi,Yi )及其方差协方差阵 DXX.精度评定(单位权中误差,点位中误差,边长相对中误差),平差相关代码:#include StdAfx.h#inclu

4、de SingleTraverse.h#include CommonSurveyFunctions.h#include math.h#include CSingleTraverse二CSingleTraverse(short TraverseType,short AngleType) m_nType=TraverseType;m_nAngleType=AngleType;if(m_nType=1)/附合导线,4个已知点m_pKnownPoint=new CControlPoint4;/已知点数组m_iKnownPointCount=4;/已知点个数2个已知点).else if(m_nType=

5、2|m_nType=3)/闭合导线与无定向导线,(m_pKnownPoint=new CControlPoint2;/已知点数组m_iKnownPointCount=2;/已知点个数).else if(m_nType=4)/ 支导线 (.m_pKnownPoint=new CControlPoint;/已知点数组m_iKnownPointCount=1;/已知点个数).else(m_pKnownPoint=NULL; /已知点数组m_iKnownPointCount=0; /已知点个数)m_pUnknownPoint=NULL;/ 未知点数组miUnknownPointCount=0; /未知

6、点个数m_pAngleObs=NULL; / m_iAngleObsCount=0;m_pDistObs=NULL; /m_iDistObsCount=0;).角度观测值数组/角度观测值个数距离观测值数组/距离观测值个数CSingleTraverse:CSingleTraverse(void)(/释放动态数组内存 if(m_pUnknownPoint!=NULL) (delete m_pUnknownPoint;m_pUnknownPoint=NULL;).if(m_pKnownPoint!=NULL)(delete m_pKnownPoint; m_pKnownPoint=NULL;)if(

7、m_pAngleObs!=NULL)(delete m_pAngleObs;第4页m_pAngleObs=NULL;if(m_pDistObs!=NULL)(delete m_pDistObs;m_pDistObs=NULL;).)/根据单导线类型,设置已知点个数和数组void CSingleTraverse二SetKnownPointSize(short nType)(m_nType=nType;if(m_nType=1)/附合导线,4个已知点(m_pKnownPoint=new CControlPoint4;/已知点数组m_iKnownPointCount=4;/ 已知点个数).else

8、if(m_nType=2|m_nType=3)/闭合导线与无定向导线,2个已知点(m_pKnownPoint=new CControlPoint2;/已知点数组m_iKnownPointCount=2;/ 已知点个数).else if(m_nType=4)/ 支导线(.m_pKnownPoint=new CControlPoint;/已知点数组m_iKnownPointCount=1;/ 已知点个数).else(m_pKnownPoint=NULL; / 已知点数组m_iKnownPointCount=0; /已知点个数).)/设置未知点个数,根据导线类型计算出角度与距离观测值个数/注意:调用

9、该函数后,原有数据被删除 void CSingleTraverse二SetUnknownPointSize(int size) (if(m_pUnknownPoint!=NULL)(delete m_pUnknownPoint; m_pUnknownPoint=NULL;if(m_pAngleObs!=NULL)(delete m_pAngleObs;m_pAngleObs=NULL;.if(m_pDistObs!=NULL)(delete m_pDistObs;m_pDistObs=NULL;m_iUnknownPointCount=size;m_pUnknownPoint=new CCon

10、trolPointsize;if(m_nType=1|m_nType=2)/ 闭合导线或附合导线(m_pAngleObs=new CAngleObssize+2;m_iAngleObsCount=size+2;m_pDistObs=new CDistObssize+1;m_iDistObsCount=size+1;else if(m_nType=3)/ 无定向导线(.m_pAngleObs=new CAngleObssize;m_iAngleObsCount=size;m_pDistObs=new CDistObssize+1;m_iDistObsCount=size+1;else/支导线(m

11、_pAngleObs=new CAngleObssize;m_iAngleObsCount=size;m_pDistObs=new CDistObssize;m_iDistObsCount=size;/对已知点数组中的第pos点赋值,pos从0开始bool CSingleTraverse二SetKnownPoint(int pos,const CControlPoint& CP) (if(pos=m_iKnownPointCount) return false;m_pKnownPointpos=CP;return true;)/对未知点数组中的第pos点赋值,pos从0开始bool CSing

12、leTraverse:SetUnKnownPoint(int pos,const CControlPoint& CP)(if(pos=m_iUnknownPointCount) return false;m_pUnknownPointpos=CP;return true;)/对角度观测数组中的第pos个观测值赋值,pos从0开始bool CSingleTraverse二SetAngleObs(int pos, const CAngleObs& AngObs)(if(pos=m_iAngleObsCount) return false;m_pAngleObspos=AngObs;return t

13、rue;)/对距离观测数组中的第pos个观测值赋值,pos从0开始bool CSingleTraverse二SetDistObs(int pos, const CDistObs& DistObs)(if(pos=m_iDistObsCount) return false;m_pDistObspos=DistObs;return true;)/已知两个控制点,求P1-P2的方位角CAngle CSingleTraverse:Azi(const CControlPoint& P1, constCControlPoint& P2)(CAngle angAzi;angAzi(RAD尸Azimuth(P

14、1.X,P1.Y,P2.X,P2.Y);return angAzi;)/已知两个控制点,求P1-P2的距离double CSingleTraverse:HDist(const CControlPoint& P1, constCControlPoint& P2)(return Dist(P1.X,P1.Y,P2.X,P2.Y);)/计算角度闭合差CAngle CSingleTraverse:ComAngleClosedError(void)(CAngle angClosedError;/闭合差角度对象/* A(i+1)=A(i)+ 左角一180A(i+1)=A(i)- 右角 + 180如果大于3

15、60度还要减360*/if (m_nType = 1) / 附合导线.CAngle StartBearing;/ 起始方位角CAngle EndBearing;/终点附合方位角StartBearing = Azi(m_pKnownPoint0,m_pKnownPoint1);EndBearing = Azi(m_pKnownPoint2,m_pKnownPoint3);/沿导线路线递推终止边的方位角for(int i=0;i 360)StartBearing(DEG) = StartBearing(DEG) - 360;else if (StartBearing(DEG) 0)StartBea

16、ring(DEG) = StartBearing(DEG) + 360;angClosedError= StartBearing- EndBearing;else if (m_nType = 2)/ 闭合导线CAngle angSum(0,DEG);/第一个角为连接角,不参与闭合差计算与角度分配for( int i = 1;im_iAngleObsCount;i+) angSum= angSum+ m_pAngleObsi.ObsValue ;angClosedError(DEG)= angSum(DEG- (m_iAngleObsCount - 2) * 180;return angClos

17、edError;/分配角度闭合差void CSingleTraverse二DistributeAngleError(const CAngle& AngleError) (if(m_nType= 1) /附合导线(for(int i=0;im_iAngleObsCount;i+)(.m_pAngleObsi.ObsValue(DEG) = m_pAngleObsi.ObsValue(DEG) -(AngleError(DEG)/m_iAngleObsCount); else if( m_nType= 2)/ 闭合导线 (./第一个角为连接角,不参与闭合差计算与角度分配for(int i=1;im

18、_iAngleObsCount;i+)(.m_pAngleObsi.ObsValue(DEG) = m_pAngleObsi.ObsValue(DEG) -(AngleError(DEG)/(m_iAngleObsCount-1); 一 /近似坐标推算及坐标闭合差计算 注意:fx,fy以引用的方式调用,把闭合差传递出来 void CSingleTraverse二CoorClosedError(double& fx, double& fy) ( double dx, dy; if(m_nType= 1|m_nType= 2)/附合导线或闭合导线( CAngle StartBearing;/ 起始

19、方位角 StartBearing = Azi(m_pKnownPoint0,m_pKnownPoint1);/沿导线路线递推终止边的方位角 for(int i=0;i 360)StartBearing(DEG) = StartBearing(DEG) - 360;else if (StartBearing(DEG) X+dx-m_pAngleObsi.cpEndObj-X;fy=m_pAngleObsi.cpStation-Y+dy-m_pAngleObsi.cpEndObj-Y; 一 )else/计算未知点近似坐标(m_pAngleObsi.cpEndObj-X=m_pAngleObsi.c

20、pStation-X + dx; m_pAngleObsi.cpEndObj-Y=m_pAngleObsi.cpStation-Y + dy; 一 ) ) ) )/分配坐标闭合差,得到简易平差结果void CSingleTraverse二DistributeCoorError(constdouble& fx, constdouble& fy)(/ 导线全长double dTotalLength = 0;for(int i=0;im_iDistObsCount;i+)(.dTotalLength=dTotalLength+m_pDistObsi.dDist;)/分配坐标闭合差,注意:是坐标增量按

21、比例分配,反号分配double dx=0, dy=0;for(int i=0;iX=m_pDistObsi.cpEnd-X-dx;m_pDistObsi.cpEnd-Y=m_pDistObsi.cpEnd-Y-dy;) 一一)/简易平差计算主程序void CSingleTraverse:SimpleAdjust(const CString& strFileName)(CAngle AngleError;AngleError = ComAngleClosedError();/计算角度闭合差DistributeAngleError(AngleError);/分配角度闭合差double fx, fy

22、, fD, K;CoorClosedError(fx, fy);/近似坐标推算及坐标闭合差计算DistributeCoorError(fx, fy);/分配坐标闭合差/相对误差计算 fD = sqrt(fx * fx + fy * fy); /导线全长double dTotalLength = 0;for(int i=0;im_iDistObsCount;i+) (.dTotalLength=dTotalLength+m_pDistObsi.dDist;一K = fD / dTotalLength;/开始输出简易平差的结果CStdioFile SF;CString strLine; setlo

23、cale(LC_ALL,);if(!SF.Open(strFileName, CFile:modeCreate|CFile:modeWrite) return; / 开始写数据 SF.WriteString(_T( 单导线近似平差结果n); strLine.Format(_T(导线类型:%dn),m_nType);SF.WriteString(strLine);第11页/ 写已知点数据strLine.Format(_T(已知点个数:%dn),m_iKnownPointCount);SF.WriteString(strLine);for(int i=0;im_iKnownPointCount;i

24、+).strLine.Format(_T(%s,%s,%.4f,%.4f,%.4fn),m_pKnownPointi.strName,m_pKnownPointi.strID,m_pKnownPointi.X,m_pKnownPointi.Y,m_pKnownPointi.H);SF.WriteString(strLine);/写未知点平差后数据/写未知点数据strLine.Format(_T(未知点个数:dn),m_iUnknownPointCount);SF.WriteString(strLine);for(int i=0;im_iUnknownPointCount;i+) strLine

25、.Format(_T(%s,%s,%.4f,%.4f,%.4fn),m_pUnknownPointi.strName,m_pUnknownPointi.strID,m_pUnknownPointi.X,m_pUnknownPointi.Y,m_pUnknownPointi.H); SF.WriteString(strLine);/ 写角度闭合差strLine.Format(_T( 角度闭合差:%.1f秒n角度闭合差限差为:%.1f 秒 n),AngleError(DEG)*3600,40* sqrt(double(m_iAngleObsCount);SF.WriteString(strLine

26、);/ 写坐标闭合差strLine.Format(_T(坐标闭合差:fx=%.2fcm fy=%.2fcmn),fx,fy);SF.WriteString(strLine);/写边长观测精度strLine.Format(_T(边长观测精度:1/%d),int(1.0/K);SF.WriteString(strLine);SF.Close();第12页/字符串分割函数CString* CSingleTraverse:SplitString(CString str , char split, int iSubStrs) (int iPos = 0; /分割符位置int iNums = 0; / 分

27、割符的总数CString strTemp = str;CString strRight;/先计算子字符串的数量while (iPos != -1) (iPos = strTemp.Find(split);if (iPos = -1)( break;strRight = strTemp.Mid(iPos + 1, str.GetLength();strTemp = strRight;iNums+;if (iNums = 0) /没有找到分割符(/子字符串数就是字符串本身iSubStrs = 1;return NULL;/ 子字符串数组iSubStrs = iNums + 1; / 子用的数量=

28、分割符数量+ 1CString* pStrSplit;pStrSplit = new CStringiSubStrs;strTemp = str;CString strLeft;for (int i = 0; i iNums; i+) (iPos = strTemp.Find(split);/左子用strLeft = strTemp.Left(iPos);/右子用strRight = strTemp.Mid(iPos + 1, strTemp.GetLength();strTemp = strRight;pStrSpliti = strLeft;第13页pStrSplitiNums = str

29、Temp; return pStrSplit;/导入观测数据函数bool CSingleTraverse:LoadObsData(const CString& strFileName) (CStdioFile sf; /创建文件对象/以读的形式打开文件,如果打开失败则返回if(!sf.Open(strFileName, CFile:modeRead) return false;CString strLine;BOOL bEOF=sf.ReadString(strLine);/ 读取第一行,单导线类型 m_nType= _ttoi(strLine); /把读取的第一行字符串转换为数值型SetKn

30、ownPointSize(m_nType);/根据单导线类型设置已知点个数及数组大 小/开始读取已知点数据sf.ReadString(strLine);/ 已知点个数if(m_iKnownPointCount!= _ttoi(strLine)一一return false;)int n=0;/读取并保存已知点数据for(int i=0;im_iKnownPointCount;i+)sf.ReadString(strLine);CString *pstrData=SplitString(strLine,n);m_pKnownPointi.strName=pstrData0;m_pKnownPoin

31、ti.strID=pstrData1;m_pKnownPointi.X=_tstof(pstrData2);m_pKnownPointi.Y=_tstof(pstrData3);m_pKnownPointi.H=_tstof(pstrData4);delete pstrData;pstrData=NULL;)/开始读取未知知点数据sf.ReadString(strLine);/ 未知点个数SetUnknownPointSize(_ttoi(strLine);/读取并保存未知点数据for(int i=0;im_iUnknownPointCount;i+)第14页sf.ReadString(str

32、Line);CString *pstrData=SplitString(strLine,n);m_pUnknownPointi.strName=pstrData0;m_pUnknownPointi.strID=pstrData1;delete pstrData;pstrData=NULL;/开始读取角度观测值数据sf.ReadString(strLine);/ 角度类型m_nAngleType=_ttoi(strLine);sf.ReadString(strLine);/角度观测值个数if(m_iAngleObsCount!= _ttoi(strLine).return false;/读取并保

33、存角度观测值数据for(int i=0;im_iAngleObsCount;i+)sf.ReadString(strLine);CString *pstrData=SplitString(strLine,n);m_pAngleObsi.cpStation =SearchPointUsingID(pstrData0);m_pAngleObsi.cpStartObj =SearchPointUsingID(pstrData1);m_pAngleObsi.cpEndObj =SearchPointUsingID(pstrData2);m_pAngleObsi.ObsValue =CAngle(_ts

34、tof(pstrData3),DMS);delete pstrData;pstrData=NULL;/开始读取边长观测值数据sf.ReadString(strLine);/边长观测值个数if(m_iDistObsCount!= _ttoi(strLine)return false;/读取并保存边长观测值数据for(int i=0;im_iDistObsCount;i+)sf.ReadString(strLine);CString *pstrData=SplitString(strLine,n);m_pDistObsi.cpStart =SearchPointUsingID(pstrData0)

35、;m_pDistObsi.cpEnd =SearchPointUsingID(pstrData1);m_pDistObsi.dDist =_tstof(pstrData2);delete pstrData;第15页pstrData=NULL;) sf.Close(); return true;)/根据点号从已知点数组中找到控制点,并返回该点的指针 CControlPoint* CSingleTraverse:SearchKnownPointUsingID(CString strID) for(int i=0;im_iKnownPointCount;i+) if(strID=m_pKnownPo

36、inti.strID) return &m_pKnownPointi;).) return NULL;)/根据点号从未知点数组中找到控制点,并返回该点的指针CControlPoint* CSingleTraverse:SearchUnknownPointUsingID(CString strID) for(int i=0;im_iUnknownPointCount;i+) if(strID=m_pUnknownPointi.strID) return &m_pUnknownPointi;).) return NULL;)/根据点号从未知点和已知点数组中找到控制点,并返回该点的指针 CContr

37、olPoint* CSingleTraverse:SearchPointUsingID(CString strID) CControlPoint* pCP=NULL;pCP=SearchKnownPointUsingID(strID);if(pCP=NULL) pCP=SearchUnknownPointUsingID(strID);) return pCP;)第16页/严密平差(间接平差)计算主函数void CSingleTraverse二RigorousAdjust(const CString& strFileName) (/开始输出间接平差的结果CStdioFile SF;CString

38、 strLine;setlocale(LC_ALL,);if(!SF.Open(strFileName,CFile二modeCreate|CFile二modeWrite)return;/开始写数据SF.WriteString(_T( 单导线间接平差结果n);strLine.Format(_T(导线类型:dn),m_nType);SF.WriteString(strLine);/ 写已知点数据strLine.Format(_T(已知点个数:dn),m_iKnownPointCount);SF.WriteString(strLine);for(int i=0;im_iKnownPointCount

39、;i+)(strLine.Format(_T(%s,%s,%.4f,%.4f,%.4fn),m_pKnownPointi.strName,m_pKnownPointi.strID,m_pKnownPointi.X,m_pKnownPointi.Y,m_pKnownPointi.H);SF.WriteString(strLine);/第一步:计算未知点近似坐标double fx, fy;CoorClosedError(fx, fy);/该函数计算坐标闭合差的同时推算了未知点的近似坐标/ 把未知点近似坐标写入文件strLine.Format(_T(未知点个数:dn),m_iUnknownPoint

40、Count);SF.WriteString(strLine);for(int i=0;im_iUnknownPointCount;i+)(strLine.Format(_T(%s,%s,%.4f,%.4f,%.4fn),m_pUnknownPointi.strName,m_pUnknownPointi.strID,m_pUnknownPointi.X,m_pUnknownPointi.Y,m_pUnknownPointi.H);SF.WriteString(strLine);第17页/写坐标闭合差strLine.Format(_T( 坐 标 闭 合 差 : fx=%,2fcmfy=%.2fcm

41、n),fx*100,fy*100);SF.WriteString(strLine);/ 第二步:计算角度观测值误差方程的系数和常数项/ 第三步:计算边长观测值误差方程的系数和常数项/ 第四步:组成误差方程/以上三步包含在FormErrorEquations函数中/ 第五步:定权,得到权矩阵int iTotalObsCount=m_iAngleObsCount+m_iDistObsCount;CMatrix P(iTotalObsCount,iTotalObsCount);P=Weight(10, 1);/ 第六步:组成并解算法方程CMatrix B, L;CMatrix BT, N, InvN

42、, detX, V;/ 注意:detX,即坐标改正数的单位为mmdoFormErrorEquations(B, L);BT = B;N = BT*P * B;InvN = N.Inv();detX = InvN * (BT * P * L);while(MaxAbsDetX(detX) 0.1);/ 第六步:精度评定V = B * detX - L;/输出系数阵和常数项SF.WriteString(_T(B 矩阵:rn);OutMatrixToFile(B,SF);/输出权矩阵SF.WriteString(_T(rnP 矩阵(对角阵):rn);OutMatrixToFile(P,SF);SF.

43、WriteString(_T( 坐标改正数(mm): rn);for(int i=0;im_iUnknownPointCount;i+)(m_pUnknownPointi.X+=detX(2 * i, 0) / 1000;m_pUnknownPointi.Y+=detX(2 * i+1,0) / 1000;strLine.Format(_T(%.1f,%.1frn),detX(2 * i, 0),detX(2 * i+1,0);第18页SF.WriteString(strLine);)SF.WriteString(_T(N矩阵:rn);OutMatrixToFile(N,SF);SF.Writ

44、eString(_T(N矩阵的逆矩阵:rn);OutMatrixToFile(InvN,SF);CMatrix W;W = BT * P * L;SF.WriteString(_T(W 矩阵:rn);OutMatrixToFile(W,SF);/第七步:输出平差结果至结果文件中/输出观测值残差SF.WriteString(_T(观测值残差(mm): rn);OutMatrixToFile(V,SF);/计算单位权中误差,并输出CMatrix Omiga,Dxx,DLL;Omiga = -V * P * V;double Sigma;Sigma = sqrt(Omiga(0, 0) / (m_i

45、AngleObsCount + m_iDistObsCount - m_iUnknownPointCount * 2);strLine.Format(_T( 单位权中误差(mm): %.1frn),Sigma);SF.WriteString(strLine);Dxx=Sigma*Sigma*InvN;SF.WriteString(_T(Dxx(mm):rn);OutMatrixToFile(Dxx,SF);DLL=B*Dxx*BT;SF.WriteString(_T(DLL(mm):rn);OutMatrixToFile(DLL,SF);double Qx;SF.WriteString(_T(

46、 点位误差(mm): rn);for(int i=0;iInvN.Row();i+)(Qx=sqrt(InvN(i,i)*Sigma;strLine.Format(_T(%.1f ),Qx);SF.WriteString(strLine);)SF.WriteString(_T(Hrn);第19页/输出平差后观测值SF.WriteString(_T(平差后角度观测值(DMS): rn);CAngle angAdj;for(int i=0;im_iAngleObsCount;i+).angAdj(DEG)=m_pAngleObsi.ObsValue(DEG)+ V(i, 0)/3600;strLi

47、ne.Format(_T(%.5f ),angAdj(DMS);SF.WriteString(strLine);SF.WriteString(_T(Hrn);SF.WriteString(_T( 平差后边长观测值(m): rn);for(int i=0;im_iDistObsCount;i+)strLine.Format(_T(%.4f),m_pDistObsi.dDist+V(i+m_iAngleObsCount, 0);SF.WriteString(strLine);SF.WriteString(_T(Hrn);/写未知点平差后未知点坐标SF.WriteString(_T(未知点平差后坐标

48、如下(m): rn);for(int i=0;im_iUnknownPointCount;i+) strLine.Format(_T(%s,%s,%.4f,%.4frn), m_pUnknownPointi.strName, m_pUnknownPointi.strID, m_pUnknownPointi.X, m_pUnknownPointi.Y);SF.WriteString(strLine);SF.Close();/把矩阵输出到文件中void CSingleTraverse二OutMatrixToFile(const CMatrix& mat,CStdioFile& SF)CString

49、 strLine,strTmp;for(int i=0;imat.Row();i+)strLine.Empty();for(int j=0;jmat.Col();j+)第20页strTmp.Format(_T(%.4f ),mat(i,j);strLine=strLine+strTmp;)SF.WriteString(strLine+_T(rn);)/定权,SigmaAng为角度观测值先验精度(以秒为单位),/SigmaDist距离观测的精度(以厘米为单位)CMatrix CSingleTraverse:Weight(double SigmaAng, double SigmaDist) (in

50、t iTotalObsCount=m_iAngleObsCount+m_iDistObsCount;CMatrix P(iTotalObsCount, iTotalObsCount);P.Unit();for(int i=0;iY - AngObs.cpStation-Y) / (Sij *Sij) / 1000;Bij = -Ro * (AngObs.cpStartObj-X - AngObs.cpStation-X) / (Sij*Sij) / 1000;Sik = HDist(*AngObs.cpEndObj, *AngObs.cpStation);Aik = Ro * (AngObs.

51、cpEndObj-Y - AngObs.cpStation-Y) / (Sik*Sik) /第21页1000;Bik = -Ro * (AngObs.cpEndObj-X - AngObs.cpStation-X) / (Sik*Sik) / 1000;Ai = Aik - Aij;Bi = Bik - Bij;Aj = Aij;Bj = Bij;Ak = -Aik;Bk = -Bik;CAngle Fij, Fik;Fij = Azi(*AngObs.cpStation , *AngObs.cpStartObj );Fik = Azi(*AngObs.cpStation , *AngObs.

52、cpEndObj);double Beta;Beta= Fik(RAD) - Fij(RAD);/左角的计算值if(BetaX - DistObs.cpStart-X) / Sik;第22页d = (DistObs.cpEnd-Y - DistObs.cpStart-Y) / Sik;Ci = -c;Di = -d;Ck = c;Dk = d;Li = (DistObs.dDist - Sik) * 1000;/常数项以毫米为单位)/组成误差方程,B为系数矩阵,L为常数项向量void CSingleTraverse:FormErrorEquations(CMatrix& B, CMatrix&

53、 L) (int iObsCount, iUnknownCount;iObsCount = m_iAngleObsCount + m_iDistObsCount;iUnknownCount = m_iUnknownPointCount * 2;B.SetSize(iObsCount, iUnknownCount);L.SetSize(iObsCount, 1);/计算角度观测值系数与常数项double Ai, Bi, Aj, Bj, Ak, Bk, Li;for(int i=0;im_iAngleObsCount;i+)(.ComAngleObsEff(m_pAngleObsi, Li, Ai

54、, Bi, Aj, Bj, Ak, Bk);L(i, 0) = Li;if(i= 0)(B(i, 0) = Ak;B(i, 1) = Bk;)else if(i = 1)(B(i, 0) = Ai;B(i, 1) = Bi;B(i, 2) = Ak;B(i, 3) = Bk;)else if( i = m_iAngleObsCount - 2)(.B(i, (m_iAngleObsCount - 4) * 2) = Aj;B(i, (m_iAngleObsCount - 4) * 2 + 1) = Bj;B(i, (m_iAngleObsCount - 3) * 2) = Ai;B(i, (m

55、_iAngleObsCount - 3) * 2 + 1) = Bi;).else if( i = m_iAngleObsCount - 1)第23页(B(i, (m_iAngleObsCount - 3) * 2) = Aj;B(i, (m_iAngleObsCount - 3) * 2 + 1) = Bj;). else (B(i, (i - 2) * 2) = Aj;B(i, (i - 2) * 2 + 1) = Bj;B(i, (i - 1) * 2) = Ai;B(i, (i - 1) * 2 + 1) = Bi;B(i, i * 2) = Ak;B(i, i * 2 + 1) =

56、Bk;) )/计算边长观测值系数与常数项double Ci, Di, Ck, Dk;for(int i=0;im_iDistObsCount;i+)(ComDistObsEff(m_pDistObsi, Li, Ci, Di, Ck, Dk);L(i + m_iAngleObsCount, 0) = Li;if(i=0)(B(i + m_iAngleObsCount, 0) = Ck;B(i + m_iAngleObsCount, 1) = Dk;)else if( i = m_iDistObsCount - 1) (.B(i + m_iAngleObsCount, (m_iDistObsCo

57、unt - 2) * 2) = Ci;B(i + m_iAngleObsCount, (m_iDistObsCount - 2) * 2 + 1) = Di; )一一else (B(i + m_iAngleObsCount, (i - 1) * 2) = Ci;B(i + m_iAngleObsCount, (i - 1) * 2 + 1) = Di;B(i + m_iAngleObsCount, i * 2) = Ck;B(i + m_iAngleObsCount, i * 2 + 1) = Dk;).)/求未知改正数绝对值最大的 double CSingleTraverse:MaxAbsD

58、etX(const CMatrix& detX)第24页double max=0;for(int i=0;imax)(max=fabs(detX(i,0);return max;3)平差结果(计算数据是自己找的有正确答案的数据)导线类型:1*已知点个数:4A,A,3157.3850,-8904.1270,0.0000B,B,3020.3480,-9049.8010,0.0000C,C,3702.4370,-10133.3990,0.0000D,D,3808.4450,-9963.8040,0.0000*未知点个数:41,1,3046.3670,-9253.0947,0.00002,2,3071

59、.8143,-9451.6003,0.00003,3,3059.5355,-9796.5348,0.00004,4,3286.6704,-9956.9298,0.0000*坐标闭合差:fx=5.44cm fy=6.49cm*B矩阵:0.99830.12780.00000.00000.00000.00000.00000.0000-2.0206-0.25881.02230.13110.00000.00000.00000.0000第25页P矩阵(对角阵):1.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000

60、.00001.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00001.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00001.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00001.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000.00000

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论