⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xvtransf.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
📖 第 1 页 / 共 3 页
字号:
      fprintf(f2,'******************************\n');

   elseif (select == 13)                    % ENU to Geodetic Transformation

      penu(1) = input('Enter x-component of the input vector --> ');
      penu(2) = input('Enter y-component of the input vector --> ');
      penu(3) = input('Enter z-component of the input vector --> ');
      pgdref(1) = input('Enter reference latitude in radians --> ');
      pgdref(2) = input('Enter reference longitude in radians --> ');
      pgdref(3) = input('Enter reference altitude in meters --> ');

%  Determine the output vector

      voutput = venugd(penu,pgdref);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      x_enu  = %20.12f\n',penu(1));
      fprintf(f2,'      y_enu  = %20.12f\n',penu(2));
      fprintf(f2,'      z_enu  = %20.12f\n',penu(3));
      fprintf(f2,'      lat_ref  = %20.12f\n',pgdref(1));
      fprintf(f2,'      lon_ref  = %20.12f\n',pgdref(2));
      fprintf(f2,'      alt_ref  = %20.12f\n',pgdref(3));
      fprintf(f2,'\n*****   Output Geodetic vector   *****\n');
      fprintf(f2,'      lat_rad  = %20.12f\n',voutput(1));
      fprintf(f2,'      lon_rad  = %20.12f\n',voutput(2));
      fprintf(f2,'      alt_m    = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

   elseif (select == 14)                    % Geodetic to ENU Transformation

      pgd(1) = input('Enter latitude of the input vector, in radians --> ');
      pgd(2) = input('Enter longitude of the input vector, in radians --> ');
      pgd(3) = input('Enter altitude of the input vector, in meters --> ');
      pgdref(1) = input('Enter reference latitude in radians --> ');
      pgdref(2) = input('Enter reference longitude in radians --> ');
      pgdref(3) = input('Enter reference altitude in meters --> ');

%  Determine the output vector

      voutput = vgdenu(pgd,pgdref);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      lat  = %20.12f\n',pgd(1));
      fprintf(f2,'      lon  = %20.12f\n',pgd(2));
      fprintf(f2,'      alt  = %20.12f\n',pgd(3));
      fprintf(f2,'      lat_ref  = %20.12f\n',pgdref(1));
      fprintf(f2,'      lon_ref  = %20.12f\n',pgdref(2));
      fprintf(f2,'      alt_ref  = %20.12f\n',pgdref(3));
      fprintf(f2,'\n*****   Output ENU vector   *****\n');
      fprintf(f2,'      x_enu  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_enu  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_enu  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

   elseif (select == 15)                     % ECEF to ECI Transformation

      pecef(1) = input('Enter x-component of the input vector --> ');
      pecef(2) = input('Enter y-component of the input vector --> ');
      pecef(3) = input('Enter z-component of the input vector --> ');
      dtime = input('Enter time elapsed since reference time (sec) --> ');   

%  Determine the output vector

      voutput = vecefeci(pecef,dtime);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      x_ecef  = %20.12f\n',pecef(1));
      fprintf(f2,'      y_ecef  = %20.12f\n',pecef(2));
      fprintf(f2,'      z_ecef  = %20.12f\n',pecef(3));
      fprintf(f2,'      dtime   = %20.12f\n',dtime);
      fprintf(f2,'\n*****   Output ECI vector   *****\n');
      fprintf(f2,'      x_eci   = %20.12f\n',voutput(1));
      fprintf(f2,'      y_eci   = %20.12f\n',voutput(2));
      fprintf(f2,'      z_eci   = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      
   elseif (select == 16)                     % ECI to ECEF Transformation

      peci(1) = input('Enter x-component of the input vector --> ');
      peci(2) = input('Enter y-component of the input vector --> ');
      peci(3) = input('Enter z-component of the input vector --> ');
      dtime = input('Enter time elapsed since reference time (sec) --> ');   

%  Determine the output vector

      voutput = veciecef(peci,dtime);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      x_eci   = %20.12f\n',peci(1));
      fprintf(f2,'      y_eci   = %20.12f\n',peci(2));
      fprintf(f2,'      z_eci   = %20.12f\n',peci(3));
      fprintf(f2,'      dtime   = %20.12f\n',dtime);
      fprintf(f2,'\n*****   Output ECEF vector   *****\n');
      fprintf(f2,'      x_ecef  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_ecef  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_ecef  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

  elseif (select == 17)                    % ECEF to SGS-85 Transformation

      pecef(1) = input('Enter x-component of the input vector --> ');
      pecef(2) = input('Enter y-component of the input vector --> ');
      pecef(3) = input('Enter z-component of the input vector --> ');

%  Determine the output vector

      voutput = vecefs85(pecef);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      x_ecef   = %20.12f\n',pecef(1));
      fprintf(f2,'      y_ecef   = %20.12f\n',pecef(2));
      fprintf(f2,'      z_ecef   = %20.12f\n',pecef(3));
      fprintf(f2,'\n*****   Output SGS-85 vector   *****\n');
      fprintf(f2,'      x_sgs85  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_sgs85  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_sgs85  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      
   elseif (select == 18)                  % SGS-85 to ECEF Transformation

      psgs85(1) = input('Enter x-component of the input vector --> ');
      psgs85(2) = input('Enter y-component of the input vector --> ');
      psgs85(3) = input('Enter z-component of the input vector --> ');

%  Determine the output vector

      voutput = vs85ecef(psgs85);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      x_sgs85  = %20.12f\n',psgs85(1));
      fprintf(f2,'      y_sgs85  = %20.12f\n',psgs85(2));
      fprintf(f2,'      z_sgs85  = %20.12f\n',psgs85(3));
      fprintf(f2,'\n*****   Output ECEF vector   *****\n');
      fprintf(f2,'      x_ecef   = %20.12f\n',voutput(1));
      fprintf(f2,'      y_ecef   = %20.12f\n',voutput(2));
      fprintf(f2,'      z_ecef   = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

elseif (select == 19)                    % ECEF to PZ-90 Transformation

      pecef(1) = input('Enter x-component of the input vector --> ');
      pecef(2) = input('Enter y-component of the input vector --> ');
      pecef(3) = input('Enter z-component of the input vector --> ');

%  Determine the output vector

      voutput = vecefp90(pecef);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      x_ecef  = %20.12f\n',pecef(1));
      fprintf(f2,'      y_ecef  = %20.12f\n',pecef(2));
      fprintf(f2,'      z_ecef  = %20.12f\n',pecef(3));
      fprintf(f2,'\n*****   Output PZ-90 vector   *****\n');
      fprintf(f2,'      x_pz90  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_pz90  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_pz90  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      
   elseif (select == 20)                  % PZ-90 to ECEF Transformation

      ppz90(1) = input('Enter x-component of the input vector --> ');
      ppz90(2) = input('Enter y-component of the input vector --> ');
      ppz90(3) = input('Enter z-component of the input vector --> ');

%  Determine the output vector

      voutput = vp90ecef(ppz90);

%  Save the results if the output file is specified or display on screen

      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      fprintf(f2,'\n*****   Input data   *****\n');
      fprintf(f2,'      x_pz90  = %20.12f\n',ppz90(1));
      fprintf(f2,'      y_pz90  = %20.12f\n',ppz90(2));
      fprintf(f2,'      z_pz90  = %20.12f\n',ppz90(3));
      fprintf(f2,'\n*****   Output ECEF vector   *****\n');
      fprintf(f2,'      x_ecef  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_ecef  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_ecef  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');
      
   else

      disp('Selection is not in the designated range');
   
   end

%  Select another computation, if desired

   disp(' ');
   answer = input('Do you want another computation? (y/n)[n] --> ','s');
   disp(' ');

end

disp('End of the program  XVTRANSF ');
disp(' ');

⌨️ 快捷键说明

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