单向空间后方交会C++代码实现

这是一个关于摄影测量的作业,重点介绍了如何使用C++进行空间后方交会的代码实现。代码中预设了像点、地面点坐标、摄影比例尺和焦距等参数,使用者可以根据自身需求调整这些已知元素。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

摄影测量作业
空间后方交会的代码
各位小伙伴要用的话 只需修改main函数里边的像点地面点坐标,摄影比例尺分母,焦距等这些已知元素就行。

#include<iostream>
#include <iomanip>
#include<string.h>
#include<math.h>
using namespace std;
void PrintArray(double* a, int b, int c);//打印矩阵
void TranspositionArray(double* a, double* aT, int b, int c);//转置矩阵
void MultiplyArray(double* a, double* b, double* c, int m, int n, int l);//矩阵相乘
void make2array(double**& a, int n);
void deletarray(double**& a, int n);
int ConverseArray(double* ip, double* rp, int n);//矩阵求逆
void SubtratArray(double* a, double* b, double* c, int m, int n);//矩阵相减

int main() {
	//像点坐标和地面点坐标
	double IroundControl[4][2] = { -86.15,-68.99,
								-53.40,82.21,
								-14.78,-76.63,
								10.46,64.43 };
	double GroundControl[4][3] = { 36589.41, 25273.32,2195.17,
								37631.08,31324.51,728.69,
								39100.97,24934.98,2386.50,
								40426.54,30319.81,757.31 };
	//摄影比例尺分母
	double scale = 40000.0;
	double f = 0.15324;

	//转换单位
	for (int i = 0; i < 4; i++)
	{
		for (int j = 0; j < 2; j++)
		{
			IroundControl[i][j] /= 1000.0;
		}
	}


	//定义外方位元素
	double Xs = 0.0, Ys = 0.0, Zs = 0.0, pitch = 0.0, roll = 0.0, yaw = 0.0;
	//外方位元素的改正数
	double delta[6] = { 0.0 };
	//定义旋转矩阵
	double Rotate[3][3] = { 0.0 };

	Xs = (GroundControl[0][0] + GroundControl[1][0] + GroundControl[2][0] + GroundControl[3][0]) / 4.0;
	Ys = (GroundControl[0][1] + GroundControl[1][1] + GroundControl[2][1] + GroundControl[3][1]) / 4.0;
	Zs = scale * f;

	//打印外方位元素的初始值
	cout << "外方位元素的初始值为:" << endl;
	cout << Xs << "   " << Ys << "   " << Zs << endl;
	cout << pitch << "   " << roll << "   " << yaw << endl;

	double x[4] = { 0 }, y[4] = { 0 
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值