




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace spaceresection class SpaceResection double SR_R = new double9;/ 旋转矩阵 double SR_A;/误差方程系数 double SR_AA=new double36;/ATPA double SR_DX = new double6;/参数增量 double SR_X0 = new double6;/参数初值 double SR_X = new double6;/ 参数变量 double SR_L; double SR_AL = new double6; /原始数据 double R_X; double R_Y; double R_Z; double R_x; double R_y; double f;/主距 double dd;/限差 int Repeat;/迭代次数 int count;/迭代计数器 int result;/函数返回值,临时变量 double m;/摄影比例尺 public double SR_XS/外方位元素 get return SR_X; set value = SR_X; public double SR_M/比例尺 get return m; set value = m; public double SR_N/实际迭代次数 get return count; set value = count; public double SR_DXS/外方位元素内部精度 get return SR_DX; set value = SR_DX; /初始化各元素,计算外方位元素及精度。参数依次为物点地面坐标,像点框标坐标,摄影机主距,迭代上限,迭代精度,均以米为单位 public int SR(double R_X0, double R_Y0, double R_Z0, double R_x0, double R_y0, double f0, int n, double dd) try this.R_X = new doubleR_X0.Length; this.R_X = R_X0; this.R_Y = new doubleR_Y0.Length; this.R_Y = R_Y0; this.R_Z = new doubleR_Z0.Length; this.R_Z = R_Z0; this.R_x = new doubleR_x0.Length; this.R_x = R_x0; this.R_y = new doubleR_y0.Length; this.R_y = R_y0; this.f = f0; this.Repeat = n; this.dd = dd; SR_A = new double12 * R_X0.Length; SR_L = new double2 * R_X0.Length; Get_X0(); Get_R(); Get_A(); Get_AA(); Get_AL(); Get_DX(); Get_X(); count = 1; result = 0; while (Compare_DX() Get_R(); Get_A(); Get_AA(); Get_AL(); Get_DX(); Get_X(); count+; if (count Repeat) result = 1; break; return result; catch return 2; /计算初值和摄影比例尺 void Get_X0() int k=0; double tm = new doubleR_X.Length*R_X.Length; for (int i = 1; i R_X.Length; i+) for (int j = 0; j i; j+) tmk = Math.Pow(R_xi - R_xj,2) + Math.Pow(R_yi - R_yj,2); tmk = (Math.Pow(R_Xi - R_Xj, 2) + Math.Pow(R_Yi - R_Yj, 2) / tmk; tmk = Math.Sqrt(tmk); k+; m = tm.Sum() / (k - 1);/算术平均解算摄影比例尺 SR_X00 = R_X.Sum() / R_X.Length; SR_X01 = R_Y.Sum() / R_Y.Length; SR_X02 = R_Z.Sum() / R_Z.Length+m*f; SR_X03 = 0; SR_X04 = 0; SR_X05 = 0; /计算旋转矩阵 void Get_R() double s1 = Math.Sin(SR_X03); double s2 = Math.Sin(SR_X04); double s3 = Math.Sin(SR_X05); double c1 = Math.Cos(SR_X03); double c2 = Math.Cos(SR_X04); double c3 = Math.Cos(SR_X05); SR_R0 = c1 * c3 - s1 * s2 * s3; SR_R1 = -c1 * s3 - s1 * s2 * c3; SR_R2 = -s1 * c2; SR_R3 = c2 * s3; SR_R4 = c2 * c3; SR_R5 = -s2; SR_R6 = s1 * c3 + c1 * s2 * s3; SR_R7 = -s1 * s3 + c1 * s2 * c3; SR_R8 = c1 * c2; /计算误差方程矩阵 void Get_A() double A; double B; double C; double da; double db; double dc; double t;/中间变量。 for(int i=0;iR_X.Length;i+) double s1 = Math.Sin(SR_X03); double s2 = Math.Sin(SR_X04); double s3 = Math.Sin(SR_X05); double c1 = Math.Cos(SR_X03); double c2 = Math.Cos(SR_X04); double c3 = Math.Cos(SR_X05); da = R_Xi - SR_X00; db = R_Yi - SR_X01; dc = R_Zi - SR_X02; A = SR_R0 * da + SR_R3 * db + SR_R6 * dc; B = SR_R1 * da + SR_R4 * db + SR_R7 * dc; C = SR_R2 * da + SR_R5 * db + SR_R8 * dc; SR_A12 * i = (SR_R0 * f + SR_R2*R_xi) / C; SR_A12 * i + 1 = (SR_R3 * f + SR_R5 * R_xi) / C; SR_A12 * i + 2 = (SR_R6 * f + SR_R8 * R_xi) / C; t = R_xi * c3 - R_yi * s3; t = R_xi * t / f + f * c3; SR_A12 * i + 3 = R_yi * s2 - t * c2; t = R_xi * s3 + R_yi * c3; SR_A12 * i + 4 = -f * s3 - R_xi * t / f; SR_A12 * i + 5 = R_yi; SR_A12 * i + 6 = (SR_R1 * f + SR_R2 * R_yi) / C; SR_A12 * i + 7 = (SR_R4 * f + SR_R5 * R_yi) / C; SR_A12 * i + 8 = (SR_R7 * f + SR_R8 * R_yi) / C; t = R_xi * c3 - R_yi * s3; t = R_yi * t / f - f * s3; SR_A12 * i + 9 = -R_xi * s2 - t * c2; t = R_xi * s3 + R_yi * c3; SR_A12 * i + 10 = -f * c3 - R_yi * t / f; SR_A12 * i + 11 = -R_xi; SR_L2 * i = R_xi +f * A / C; SR_L2 * i+1 = R_yi + f * B / C; /计算ATPA矩阵 void Get_AA() for (int i = 0; i 6; i+) for (int j = 0; j 6; j+) Get_AAe(i,j); /计算各元素 void Get_AAe(int i,int j) SR_AA6*i+j=0; for (int m = 0; m (R_X.Length* 2); m+) SR_AA6 * i + j += SR_A6 * m + i * SR_A6 * m + j; void Get_AL() for (int i = 0; i 6; i+) SR_ALi = 0; for (int j = 0; j R_X.Length* 2; j+) SR_ALi += SR_Lj * SR_A6 * j + i; /高斯列主元消去法计算方程组 void Get_DX() double maxmain; double a = new double6; int b=new int6; int i; int j; int k; int temp; for (i = 0; i 6; i+) maxmain = 0; bi = -1; for (j = 0; j =maxmain) temp = 0; for (k = 0; k i;k+ ) if (j = bk) temp = 1; break; if (temp = 0) maxmain = aj; bi = j; for (j = 0; j 6; j+) if (j = bi) aj = 1 / SR_AA6 * bi + i; else aj = SR_AA6*j+i / SR_AA6 * bi + i; for (j = 0; j 6; j+) if (j = bi) continue; for (k = 0; k 6; k+) if (k i) continue; SR_AA6 * j + k -= SR_AA6 * bi + k*aj; SR_ALj -= SR_ALbi*aj; for (k = 0; k 6; k+) if (k i) continue; SR_AA6 * bi + k *= abi; SR_ALbi *= abi; for (i = 0; i 6; i+) SR_DXi = SR_ALbi; /计算外方位元素
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2023-2024学年河北省沧州市高二下学期期末教学质量监测数学试题(解析版)
- 2025年秋三年级上册语文同步教案 13 一块奶酪
- 饮酒与健康专题知识讲座
- 作业监护安全管理制度
- 供奉牌位登记管理制度
- 供暖设备安装管理制度
- 供水加压泵站管理制度
- 供热维护员工管理制度
- 项目重点难点分析及合理化建议
- 供电公司缺陷管理制度
- GB/T 4208-2017外壳防护等级(IP代码)
- GB/T 19889.8-2006声学建筑和建筑构件隔声测量第8部分:重质标准楼板覆面层撞击声改善量的实验室测量
- GB/T 12236-2008石油、化工及相关工业用的钢制旋启式止回阀
- .全年累计供暖空调能耗模拟报告
- 国家开放大学《药学信息检索》形考作业参考答案
- 自身免疫性脑炎
- 热工基础思考题答案(第1章)
- 大学生选课申请表
- 生产安全事故风险评估报告(参考模板)
- 消防安全工作台账表格汇总
- 广州旧城改造三元里文本
评论
0/150
提交评论