ImageVerifierCode 换一换
格式:DOCX , 页数:34 ,大小:22.36KB ,
资源ID:29569305      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/29569305.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(中南大学测绘课程设计控制网程序.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

中南大学测绘课程设计控制网程序.docx

1、中南大学测绘课程设计控制网程序控制网ClzControlNetAdjust头文件#pragma once#include ClzControlPoint.h#include ClzAngleObs.h#include ClzDistObs.h#include Matrix.h#include Angle.hclass ClzControlNetAdjustpublic: ClzControlNetAdjust(); ClzControlNetAdjust();private: ClzControlPoint * m_pUnknowPoint; int m_iUnknowPointCount;

2、ClzControlPoint * m_pKnowPoint; int m_iKnowPointCount; ClzAngleObs * m_pAngleObs; int m_iAngleObsCount; ClzDistObs * m_pDistObs; int m_iDistObsCount; public: double Anglesigma; double Distsigma; int m_iStationCount; bool LoadObsData(const CString& strFileName); void CoordinateEstimates(); void SetAn

3、glesigmaD(double Asigma,double Dsigma,double count); void ErrorEllipseDraw(CDC * pDC, CRect& rect); void CalculateErrorEquations(const CString& strFileName);private: ClzControlPoint* SearchKnownPointUsingID(CString strID); ClzControlPoint* SearchUnknownPointUsingID(CString strID); void SetKnowPointS

4、ize(int size); void SetUnknowPointSize(int size); void SetAngleObsSize(int size); void SetDistObsSize(int size); CString* SplitString(CString str, char split, int iSubStrs); ClzControlPoint* SearchPointUsingID(CString strPointID); Angle Azimuth(double dX1, double My1, double dX2, double My2); double

5、 HDist(ClzControlPoint* cpStation1, ClzControlPoint* cpEnd1); Angle ZeroAngle(ClzAngleObs AngleObs); void FormErrorEquations(CMatrix &B, CMatrix &f); void ComAngleObsEff(ClzAngleObs AngleObs ,double& Fi, double& Ci, double& Di, double& Ck, double& Dk); void ComDistObsEff(ClzDistObs DistObs, double&

6、Fi, double& Ci, double& Di, double& Ck, double& Dk); void FixedWeight(CMatrix &p); void GetMaxXY(double& dx, double& dy,double& minx,double& maxy); void OutMatrixToFile(const CMatrix& mat, CStdioFile& SF);控制网ClzControlNetAdujst类源文件#include stdafx.h#include ClzControlNetAdujst.h#include #include math

7、.hconst double PI =atan(1.0)*4.0;const double EPSILON = 1.0E-12;const double R0 = 206265;ClzControlNetAdjust:ClzControlNetAdjust() m_pUnknowPoint=NULL; m_iUnknowPointCount=0; m_pKnowPoint=NULL; m_iKnowPointCount=0; m_pAngleObs=NULL; m_iAngleObsCount=0; m_pDistObs=NULL; m_iDistObsCount = 0; Anglesigm

8、a=0; Distsigma=0; m_iStationCount=0;ClzControlNetAdjust:ClzControlNetAdjust() delete m_pUnknowPoint; m_pUnknowPoint = NULL; delete m_pKnowPoint; m_pKnowPoint = NULL; delete m_pAngleObs; m_pAngleObs = NULL; delete m_pDistObs; m_pDistObs = NULL;void ClzControlNetAdjust:SetKnowPointSize(int size) if (m

9、_pKnowPoint != NULL) delete m_pKnowPoint; m_pKnowPoint = NULL; m_iKnowPointCount=0; m_iKnowPointCount = size; m_pKnowPoint = new ClzControlPointsize;void ClzControlNetAdjust:SetUnknowPointSize(int size) if (m_pUnknowPoint != NULL) delete m_pUnknowPoint; m_pUnknowPoint = NULL; m_iUnknowPointCount = 0

10、; m_iUnknowPointCount = size; m_pUnknowPoint = new ClzControlPointsize;void ClzControlNetAdjust:SetAngleObsSize(int size) if (m_pAngleObs!=NULL) delete m_pAngleObs; m_pAngleObs = NULL; m_iAngleObsCount = 0; m_iAngleObsCount = size; m_pAngleObs = new ClzAngleObssize;void ClzControlNetAdjust:SetDistOb

11、sSize(int size) if (m_pDistObs!=NULL) delete m_pDistObs; m_pDistObs = NULL; m_iDistObsCount = 0; m_iDistObsCount = size; m_pDistObs = new ClzDistObssize;CString* ClzControlNetAdjust:SplitString(CString str, char split, int iSubStrs) int iPos = 0; /分割符位置 int iNums = 0; /分割符的总数 CString strTemp = str;

12、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; /子串的数量 = 分割符数量 + 1 CString*

13、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; pStrSplitiNums = strTemp; retur

14、n pStrSplit;ClzControlPoint* ClzControlNetAdjust:SearchKnownPointUsingID(CString strID) for (int i = 0; im_iKnowPointCount; i+) if (strID = m_pKnowPointi.strPointID) return &m_pKnowPointi; return NULL;ClzControlPoint* ClzControlNetAdjust:SearchUnknownPointUsingID(CString strID) for (int i = 0; i= 0)

15、 sgn = 1; else sgn = -1; A(RAD)= PI - sgn*PI / 2 - atan(dX2 - dX1) / (dY2 - dY1 + EPSILON); return A;double ClzControlNetAdjust:HDist(ClzControlPoint* cpStation1, ClzControlPoint* cpEnd1) double dDist; dDist = sqrt(cpStation1-X - cpEnd1-X)*(cpStation1-X - cpEnd1-X) + (cpStation1-Y - cpEnd1-Y)*(cpSta

16、tion1-Y- cpEnd1-Y); return dDist;Angle ClzControlNetAdjust:ZeroAngle(ClzAngleObs AngleObs) Angle ZeroAlf; for (int i = 0; i strPointID = AngleObs.cpStation-strPointID) & m_pAngleObsi.ObsAngle(DMS)-0.000000 X, m_pAngleObsi.cpStation-Y, m_pAngleObsi.cpEnd-X, m_pAngleObsi.cpEnd-Y); return ZeroAlf;void

17、ClzControlNetAdjust:FormErrorEquations(CMatrix &B, CMatrix &f) int iObsCount, iUnknownCount; iObsCount = m_iAngleObsCount + m_iDistObsCount; iUnknownCount = m_iStationCount + m_iUnknowPointCount * 2; B.SetSize(iObsCount, iUnknownCount); f.SetSize(iObsCount, 1); for (int i = 0; i iObsCount;i+) for (i

18、nt j = 0; j iUnknownCount; j+) B(i, j) = 0; for (int i = 0; i iObsCount; i+) f(i, 0) = 0; /方向值误差方程 int StationNum = 1; int tmpi = 1; for (int i = 0; i strPointID != m_pAngleObstmpi.cpStation-strPointID ) StationNum+; B(i, m_iUnknowPointCount * 2 - 1 + StationNum) = -1; tmpi = i; for (int j = 0; j st

19、rPointID = m_pUnknowPointj.strPointID) B(i, 2 * j) = ci; B(i, 2 * j + 1) = di; if (m_pAngleObsi.cpEnd-strPointID = m_pUnknowPointj.strPointID) B(i, 2 * j) = ck; B(i, 2 * j + 1) = dk; f(i, 0) = fi; /距离观测误差方程 for (int i = 0; i m_iDistObsCount; i+) double fi, ci, di, ck, dk; ComDistObsEff(m_pDistObsi,f

20、i,ci,di,ck,dk); for (int j = 0; j strPointID = m_pUnknowPointj.strPointID) B(i+m_iAngleObsCount, 2 * j) = ci; B(i+m_iAngleObsCount, 2 * j + 1) = di; if (m_pDistObsi.cpEnd-strPointID = m_pUnknowPointj.strPointID) B(i + m_iAngleObsCount, 2 * j) = ck; B(i + m_iAngleObsCount, 2 * j + 1) = dk; f(i+m_iAng

21、leObsCount, 0) = fi; void ClzControlNetAdjust:ComAngleObsEff(ClzAngleObs AngleObs , double& Fi, double& Ci, double& Di, double& Ck, double& Dk) double dXik, dYik,dSik; dXik = AngleObs.cpEnd-X - AngleObs.cpStation-X; dYik = AngleObs.cpEnd-Y - AngleObs.cpStation-Y; dSik = HDist(AngleObs.cpStation, Ang

22、leObs.cpEnd); Angle Aziik; Aziik = Azimuth(AngleObs.cpStation-X, AngleObs.cpStation-Y, AngleObs.cpEnd-X, AngleObs.cpEnd-Y ); double a, b; a = R0*dYik / (dSik*dSik * 1000.0); b =- R0*dXik / (dSik*dSik * 1000.0); Ci = a; Di = b; Ck = -a; Dk = -b; Angle Zero; Zero = ZeroAngle(AngleObs); double L0; L0 =

23、 Aziik(RAD) - Zero(RAD); if (L0 X - DistObs.cpStart-X) / dSik; d = (DistObs.cpEnd-Y - DistObs.cpStart-Y) / dSik; Ci = -c; Di = -d; Ck = c; Dk = d; Fi = (DistObs.dDist - dSik)*1000;void ClzControlNetAdjust:OutMatrixToFile(const CMatrix& mat, CStdioFile& SF) CString strLine, strTmp; for (int i = 0; im

24、at.Row(); i+) strLine.Empty(); for (int j = 0; jmat.Col(); j+) strTmp.Format(_T(%.4f ), mat(i, j); strLine = strLine + strTmp; SF.WriteString(strLine + _T(rn); void ClzControlNetAdjust:FixedWeight(CMatrix &p) int iCount = m_iAngleObsCount + m_iDistObsCount; p.SetSize(iCount, iCount); p.Unit(); for (

25、int i = m_iAngleObsCount ; i iCount; i+) p(i, i) = Anglesigma*Anglesigma / (Distsigma*Distsigma*m_pDistObsi-m_iAngleObsCount.dDist/1000); /控制网主函数void ClzControlNetAdjust:CalculateErrorEquations(const CString& strFileName) CStdioFile sf; CString strLine; setlocale(LC_ALL, ); if (!sf.Open(strFileName, CFile:modeCreate | CFile:modeWrite)return; strLine.Format(_T(概算后坐标n); sf.WriteString(strLine); strLine.Format(_T(未知点个数:%dn), m_i

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1