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

📄 xvtransf.m

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

      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 --> ');
      lat = input('Enter reference latitude  in radians --> ');   
      lon = input('Enter reference longitude in radians --> ');   
      waz = input('Enter reference wander azimuth angle in radians --> ');

%  Determine the output vector

      voutput = vecefins(pecef,lat,lon,waz);

%  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,'      latitude  (rad.)       = %20.12f\n',lat);
      fprintf(f2,'      longitude (rad.)       = %20.12f\n',lon);
      fprintf(f2,'      wander azimuth (rad.)  = %20.12f\n',waz);
      fprintf(f2,'\n*****   Output INS vector   *****\n');
      fprintf(f2,'      x_ins  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_ins  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_ins  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

   elseif (select == 6)                     % INS to ECEF Transformation

      pins(1) = input('Enter x-component of the input vector --> ');
      pins(2) = input('Enter y-component of the input vector --> ');
      pins(3) = input('Enter z-component of the input vector --> ');
      lat = input('Enter reference latitude  in radians --> ');   
      lon = input('Enter reference longitude in radians --> ');   
      waz = input('Enter reference wander azimuth angle in radians --> ');

%  Determine the output vector

      voutput = vinsecef(pins,lat,lon,waz);

%  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_ins  = %20.12f\n',pins(1));
      fprintf(f2,'      y_ins  = %20.12f\n',pins(2));
      fprintf(f2,'      z_ins  = %20.12f\n',pins(3));
      fprintf(f2,'      latitude  (rad.)       = %20.12f\n',lat);
      fprintf(f2,'      longitude (rad.)       = %20.12f\n',lon);
      fprintf(f2,'      wander azimuth (rad.)  = %20.12f\n',waz);
      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 == 7)                     % ENU to LLWA 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 --> ');
      waz = input('Enter reference wander azimuth angle in radians --> ');

%  Determine the output vector

      voutput = venullw(penu,waz);

%  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,'      wander azimuth (rad.)  = %20.12f\n',waz);
      fprintf(f2,'\n*****   Output LLWA vector   *****\n');
      fprintf(f2,'      x_llw  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_llw  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_llw  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

   elseif (select == 8)                     % LLWA to ENU Transformation

      pllw(1) = input('Enter x-component of the input vector --> ');
      pllw(2) = input('Enter y-component of the input vector --> ');
      pllw(3) = input('Enter z-component of the input vector --> ');
      waz = input('Wander azimuth angle in radians --> ');

%  Determine the output vector

      voutput = vllwenu(pllw,waz);

%  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_llw  = %20.12f\n',pllw(1));
      fprintf(f2,'      y_llw  = %20.12f\n',pllw(2));
      fprintf(f2,'      z_llw  = %20.12f\n',pllw(3));
      fprintf(f2,'      wander azimuth (rad.)  = %20.12f\n',waz);
      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 == 9)                     % LLWA to GPS body Transformation

      pllw(1) = input('Enter x-component of the input vector --> ');
      pllw(2) = input('Enter y-component of the input vector --> ');
      pllw(3) = input('Enter z-component of the input vector --> ');
      yaw   = input('Enter yaw angle in radians --> ');
      pitch = input('Enter pitch angle in radians --> ');
      roll  = input('Enter roll angle in radians --> ');

%  Determine the output vector

      voutput = vllwb(pllw,yaw,pitch,roll);

%  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_llw  = %20.12f\n',pllw(1));
      fprintf(f2,'      y_llw  = %20.12f\n',pllw(2));
      fprintf(f2,'      z_llw  = %20.12f\n',pllw(3));
      fprintf(f2,'      yaw   (rad.)  = %20.12f\n',yaw);
      fprintf(f2,'      pitch (rad.)  = %20.12f\n',pitch);
      fprintf(f2,'      roll  (rad.)  = %20.12f\n',roll);
      fprintf(f2,'\n*****   Output GPS body vector   *****\n');
      fprintf(f2,'      x_body  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_body  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_body  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

   elseif (select == 10)                    % GPS body to LLWA Transformation

      pb(1) = input('Enter x-component of the input vector --> ');
      pb(2) = input('Enter y-component of the input vector --> ');
      pb(3) = input('Enter z-component of the input vector --> ');
      yaw   = input('Enter yaw angle in radians --> ');
      pitch = input('Enter pitch angle in radians --> ');
      roll  = input('Enter roll angle in radians --> ');

%  Determine the output vector

      voutput = vbllw(pb,yaw,pitch,roll);

%  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_body  = %20.12f\n',pb(1));
      fprintf(f2,'      y_body  = %20.12f\n',pb(2));
      fprintf(f2,'      z_body  = %20.12f\n',pb(3));
      fprintf(f2,'      yaw   (rad.)  = %20.12f\n',yaw);
      fprintf(f2,'      pitch (rad.)  = %20.12f\n',pitch);
      fprintf(f2,'      roll  (rad.)  = %20.12f\n',roll);
      fprintf(f2,'\n*****   Output LLWA vector   *****\n');
      fprintf(f2,'      x_llw  = %20.12f\n',voutput(1));
      fprintf(f2,'      y_llw  = %20.12f\n',voutput(2));
      fprintf(f2,'      z_llw  = %20.12f\n',voutput(3));
      fprintf(f2,'\n**************************************************');
      fprintf(f2,'******************************\n');

   elseif (select == 11)                    % ECEF to Geodetic 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 --> ');
      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 = vecefgd(pecef,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_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,'      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 == 12)                    % Geodetic to ECEF 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 = vgdecef(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 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**************************************************');

⌨️ 快捷键说明

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