mat_test.cpp

来自「此程序为GPS软件接收机的源码」· C++ 代码 · 共 43 行

CPP
43
字号
#include  <stdio.h>
#include  <stdlib.h>
#include  <conio.h>
#include  <math.h>
#include  <string.h>
#include  <io.h>
#include  <Dos.h>
#include "CMatrix3.cpp"            // Alberto Perez,  Thanks Alberto!!
												 // They will help make the transition
												 // to a Kalman filter much easier


void main()
{
  float az[6],el[6];
  int i;
  az[0]=0.0;el[0]=90.0;
  az[1]=0.0;el[1]=5.0;
  az[2]=90.0;el[2]=5.0;
  az[3]=180.0;el[3]=5.0;
  az[4]=270.0;el[4]=5.0;
  az[5]=235.0;el[5]=45.0;

 Matrix G(4,4),H(6,4),M(4,4);

 for (i=1;i<=6;i++)
 {
	H(i,1)=cos(el[i-1]/57.296)*sin(az[i-1]/57.296);
	H(i,2)=cos(el[i-1]/57.296)*cos(az[i-1]/57.296);
	H(i,3)=sin(el[i-1]/57.296);
	H(i,4)=1.0;
 }
 DebugOut(H);
 printf("\n");
 M=H.transpose()*H;
 DebugOut(M);
 printf("\n");
 G=(H.transpose()*H).inverse();
 DebugOut(G);
 scanf("%d",&i);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?