亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? geocent.c

?? 給予QT的qps開(kāi)源最新源碼
?? C
字號(hào):
/***************************************************************************/
/* RSC IDENTIFIER:  GEOCENTRIC
 *
 * ABSTRACT
 *
 *    This component provides conversions between Geodetic coordinates (latitude,
 *    longitude in radians and height in meters) and Geocentric coordinates
 *    (X, Y, Z) in meters.
 *
 * ERROR HANDLING
 *
 *    This component checks parameters for valid values.  If an invalid value
 *    is found, the error code is combined with the current error code using 
 *    the bitwise or.  This combining allows multiple error codes to be
 *    returned. The possible error codes are:
 *
 *      GEOCENT_NO_ERROR        : No errors occurred in function
 *      GEOCENT_LAT_ERROR       : Latitude out of valid range
 *                                 (-90 to 90 degrees)
 *      GEOCENT_LON_ERROR       : Longitude out of valid range
 *                                 (-180 to 360 degrees)
 *      GEOCENT_A_ERROR         : Semi-major axis less than or equal to zero
 *      GEOCENT_INV_F_ERROR     : Inverse flattening outside of valid range
 *								                 (250 to 350)
 *
 *
 * REUSE NOTES
 *
 *    GEOCENTRIC is intended for reuse by any application that performs
 *    coordinate conversions between geodetic coordinates and geocentric
 *    coordinates.
 *    
 *
 * REFERENCES
 *    
 *    An Improved Algorithm for Geocentric to Geodetic Coordinate Conversion,
 *    Ralph Toms, February 1996  UCRL-JC-123138.
 *    
 *    Further information on GEOCENTRIC can be found in the Reuse Manual.
 *
 *    GEOCENTRIC originated from : U.S. Army Topographic Engineering Center
 *                                 Geospatial Information Division
 *                                 7701 Telegraph Road
 *                                 Alexandria, VA  22310-3864
 *
 * LICENSES
 *
 *    None apply to this component.
 *
 * RESTRICTIONS
 *
 *    GEOCENTRIC has no restrictions.
 *
 * ENVIRONMENT
 *
 *    GEOCENTRIC was tested and certified in the following environments:
 *
 *    1. Solaris 2.5 with GCC version 2.8.1
 *    2. Windows 95 with MS Visual C++ version 6
 *
 * MODIFICATIONS
 *
 *    Date              Description
 *    ----              -----------
 *    25-02-97          Original Code
 *
 */


/***************************************************************************/
/*
 *                               INCLUDES
 */
#include <math.h>
#include "geocent.h"
/*
 *    math.h     - is needed for calls to sin, cos, tan and sqrt.
 *    geocent.h  - is needed for Error codes and prototype error checking.
 */


/***************************************************************************/
/*
 *                               DEFINES
 */
#define PI         3.14159265358979323e0
#define PI_OVER_2  (PI / 2.0e0)
#define FALSE      0
#define TRUE       1
#define COS_67P5   0.38268343236508977  /* cosine of 67.5 degrees */
#define AD_C       1.0026000            /* Toms region 1 constant */


/***************************************************************************/
/*
 *                              GLOBAL DECLARATIONS
 */
/* Ellipsoid parameters, default to WGS 84 */
double Geocent_a = 6378137.0;          /* Semi-major axis of ellipsoid in meters */
double Geocent_f = 1 / 298.257223563;  /* Flattening of ellipsoid           */

double Geocent_e2 = 0.0066943799901413800;   /* Eccentricity squared  */
double Geocent_ep2 = 0.00673949675658690300; /* 2nd eccentricity squared */
/*
 * These state variables are for optimization purposes.  The only function
 * that should modify them is Set_Geocentric_Parameters.
 */


/***************************************************************************/
/*
 *                              FUNCTIONS     
 */


long Set_Geocentric_Parameters (double a, 
                                double f) 
{ /* BEGIN Set_Geocentric_Parameters */
/*
 * The function Set_Geocentric_Parameters receives the ellipsoid parameters
 * as inputs and sets the corresponding state variables.
 *
 *    a  : Semi-major axis of ellipsoid, in meters.          (input)
 *    f  : Flattening of ellipsoid.						               (input)
 */

  double inv_f = 1 / f;
  long Error_Code = GEOCENT_NO_ERROR;

  if (a <= 0.0)
    Error_Code |= GEOCENT_A_ERROR;
  if ((inv_f < 250) || (inv_f > 350))
  { /* Inverse flattening must be between 250 and 350 */
    Error_Code |= GEOCENT_INV_F_ERROR;
  }
  if (!Error_Code)
  {
    Geocent_a = a;
    Geocent_f = f;
    Geocent_e2 = 2 * Geocent_f - Geocent_f * Geocent_f;
    Geocent_ep2 = (1 / (1 - Geocent_e2)) - 1;
  }
  return (Error_Code);
} /* END OF Set_Geocentric_Parameters */


void Get_Geocentric_Parameters (double *a, 
                                double *f)
{ /* BEGIN Get_Geocentric_Parameters */
/*
 * The function Get_Geocentric_Parameters returns the ellipsoid parameters
 * to be used in geocentric coordinate conversions.
 *
 *    a  : Semi-major axis of ellipsoid, in meters.          (output)
 *    f  : Flattening of ellipsoid.						               (output)
 */

  *a = Geocent_a;
  *f = Geocent_f;
} /* END OF Get_Geocentric_Parameters */


long Convert_Geodetic_To_Geocentric (double Latitude,
                                     double Longitude,
                                     double Height,
                                     double *X,
                                     double *Y,
                                     double *Z) 
{ /* BEGIN Convert_Geodetic_To_Geocentric */
/*
 * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
 * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
 * according to the current ellipsoid parameters.
 *
 *    Latitude  : Geodetic latitude in radians                     (input)
 *    Longitude : Geodetic longitude in radians                    (input)
 *    Height    : Geodetic height, in meters                       (input)
 *    X         : Calculated Geocentric X coordinate, in meters    (output)
 *    Y         : Calculated Geocentric Y coordinate, in meters    (output)
 *    Z         : Calculated Geocentric Z coordinate, in meters    (output)
 *
 */
  long Error_Code = GEOCENT_NO_ERROR;
  double Rn;            /*  Earth radius at location  */
  double Sin_Lat;       /*  sin(Latitude)  */
  double Sin2_Lat;      /*  Square of sin(Latitude)  */
  double Cos_Lat;       /*  cos(Latitude)  */

  if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
  { /* Latitude out of range */
    Error_Code |= GEOCENT_LAT_ERROR;
  }
  if ((Longitude < -PI) || (Longitude > (2*PI)))
  { /* Longitude out of range */
    Error_Code |= GEOCENT_LON_ERROR;
  }
  if (!Error_Code)
  { /* no errors */
    if (Longitude > PI)
      Longitude -= (2*PI);
    Sin_Lat = sin(Latitude);
    Cos_Lat = cos(Latitude);
    Sin2_Lat = Sin_Lat * Sin_Lat;
    Rn = Geocent_a / (sqrt(1.0e0 - Geocent_e2 * Sin2_Lat));
    *X = (Rn + Height) * Cos_Lat * cos(Longitude);
    *Y = (Rn + Height) * Cos_Lat * sin(Longitude);
    *Z = ((Rn * (1 - Geocent_e2)) + Height) * Sin_Lat;

  }
  return (Error_Code);
} /* END OF Convert_Geodetic_To_Geocentric */


void Convert_Geocentric_To_Geodetic (double X,
                                     double Y, 
                                     double Z,
                                     double *Latitude,
                                     double *Longitude,
                                     double *Height)
{ /* BEGIN Convert_Geocentric_To_Geodetic */
/*
 * The function Convert_Geocentric_To_Geodetic converts geocentric
 * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, 
 * and height), according to the current ellipsoid parameters.
 *
 *    X         : Geocentric X coordinate, in meters.         (input)
 *    Y         : Geocentric Y coordinate, in meters.         (input)
 *    Z         : Geocentric Z coordinate, in meters.         (input)
 *    Latitude  : Calculated latitude value in radians.       (output)
 *    Longitude : Calculated longitude value in radians.      (output)
 *    Height    : Calculated height value, in meters.         (output)
 *
 * The method used here is derived from 'An Improved Algorithm for
 * Geocentric to Geodetic Coordinate Conversion', by Ralph Toms, Feb 1996
 */

/* Note: Variable names follow the notation used in Toms, Feb 1996 */

  double W;        /* distance from Z axis */
  double W2;       /* square of distance from Z axis */
  double T0;       /* initial estimate of vertical component */
  double T1;       /* corrected estimate of vertical component */
  double S0;       /* initial estimate of horizontal component */
  double S1;       /* corrected estimate of horizontal component */
  double Sin_B0;   /* sin(B0), B0 is estimate of Bowring aux variable */
  double Sin3_B0;  /* cube of sin(B0) */
  double Cos_B0;   /* cos(B0) */
  double Sin_p1;   /* sin(phi1), phi1 is estimated latitude */
  double Cos_p1;   /* cos(phi1) */
  double Rn;       /* Earth radius at location */
  double Sum;      /* numerator of cos(phi1) */
  int At_Pole;     /* indicates location is in polar region */
  double Geocent_b = Geocent_a * (1 - Geocent_f); /* Semi-minor axis of ellipsoid, in meters */

  At_Pole = FALSE;
  if (X != 0.0)
  {
    *Longitude = atan2(Y,X);
  }
  else
  {
    if (Y > 0)
    {
      *Longitude = PI_OVER_2;
    }
    else if (Y < 0)
    {
      *Longitude = -PI_OVER_2;
    }
    else
    {
      At_Pole = TRUE;
      *Longitude = 0.0;
      if (Z > 0.0)
      {  /* north pole */
        *Latitude = PI_OVER_2;
      }
      else if (Z < 0.0)
      {  /* south pole */
        *Latitude = -PI_OVER_2;
      }
      else
      {  /* center of earth */
        *Latitude = PI_OVER_2;
        *Height = -Geocent_b;
        return;
      } 
    }
  }
  W2 = X*X + Y*Y;
  W = sqrt(W2);
  T0 = Z * AD_C;
  S0 = sqrt(T0 * T0 + W2);
  Sin_B0 = T0 / S0;
  Cos_B0 = W / S0;
  Sin3_B0 = Sin_B0 * Sin_B0 * Sin_B0;
  T1 = Z + Geocent_b * Geocent_ep2 * Sin3_B0;
  Sum = W - Geocent_a * Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0;
  S1 = sqrt(T1*T1 + Sum * Sum);
  Sin_p1 = T1 / S1;
  Cos_p1 = Sum / S1;
  Rn = Geocent_a / sqrt(1.0 - Geocent_e2 * Sin_p1 * Sin_p1);
  if (Cos_p1 >= COS_67P5)
  {
    *Height = W / Cos_p1 - Rn;
  }
  else if (Cos_p1 <= -COS_67P5)
  {
    *Height = W / -Cos_p1 - Rn;
  }
  else
  {
    *Height = Z / Sin_p1 + Rn * (Geocent_e2 - 1.0);
  }
  if (At_Pole == FALSE)
  {
    *Latitude = atan(Sin_p1 / Cos_p1);
  }
} /* END OF Convert_Geocentric_To_Geodetic */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本成人在线观看| 国产一区二区三区香蕉| 久久99久久精品| av亚洲精华国产精华精| 精品久久久久久最新网址| 亚洲男人都懂的| 国产成人精品免费在线| 精品欧美一区二区久久| 亚洲国产人成综合网站| gogo大胆日本视频一区| 久久久久久免费毛片精品| 天天av天天翘天天综合网| 91色乱码一区二区三区| 久久久亚洲高清| 久久国产福利国产秒拍| 4438x成人网最大色成网站| 一区二区在线观看免费视频播放 | 粉嫩嫩av羞羞动漫久久久| 欧美丰满少妇xxxxx高潮对白| 中文字幕一区二区三区四区 | 日本最新不卡在线| 欧美在线综合视频| 亚洲精品成人少妇| 不卡一卡二卡三乱码免费网站 | 67194成人在线观看| 亚洲一区二区三区四区在线免费观看 | 91精品中文字幕一区二区三区| 亚洲男人的天堂一区二区| a在线欧美一区| 中文字幕高清一区| 国产精品18久久久久久vr| 精品美女一区二区| 蜜桃视频一区二区| 欧美电影一区二区三区| 天天av天天翘天天综合网色鬼国产| 91福利区一区二区三区| 一区二区三区 在线观看视频 | 国产精品一区二区果冻传媒| 久久久久久毛片| 国产成人在线视频播放| 一区二区三区在线视频播放| 色av一区二区| 亚洲一区二区三区在线播放| 欧美三级日本三级少妇99| 亚洲超碰97人人做人人爱| 欧美裸体一区二区三区| 青青草国产精品亚洲专区无| 日韩三级精品电影久久久| 韩国毛片一区二区三区| 国产精品毛片大码女人 | 精品无人码麻豆乱码1区2区| 久久人人超碰精品| 99久久99久久综合| 亚洲bt欧美bt精品777| 日韩欧美国产1| 国产91综合一区在线观看| 亚洲人成网站在线| 欧美久久久久免费| 国产麻豆成人传媒免费观看| 亚洲欧美在线观看| 欧美理论电影在线| 国产精品一区二区免费不卡| 一区二区三区中文字幕| 91精品国产色综合久久不卡电影| 国产一区美女在线| 中文字幕在线观看一区| 欧美美女一区二区在线观看| 国产精品中文字幕日韩精品| 一区二区三区高清不卡| 久久综合狠狠综合久久综合88 | 欧美一级在线视频| 不卡影院免费观看| 日本成人在线一区| 国产精品福利影院| 日韩三级在线免费观看| 91色九色蝌蚪| 国产美女精品一区二区三区| 亚洲一区二区三区四区的| 2014亚洲片线观看视频免费| 欧美羞羞免费网站| 成人av网站免费观看| 美女免费视频一区| 亚洲一区成人在线| **欧美大码日韩| 精品国产一区二区在线观看| 欧美偷拍一区二区| 春色校园综合激情亚洲| 麻豆成人av在线| 亚洲一区二区av电影| 中文字幕在线不卡一区| 久久久综合精品| 欧美剧在线免费观看网站| 91在线你懂得| 成人免费不卡视频| 国产精品夜夜嗨| 日韩精品亚洲一区| 午夜视频一区在线观看| 亚洲欧洲综合另类在线| 国产精品区一区二区三| 精品国产a毛片| 欧美一二三在线| 欧美日韩一区二区三区免费看| 99精品国产热久久91蜜凸| 成人综合婷婷国产精品久久免费| 日韩电影在线免费看| 五月综合激情日本mⅴ| 亚洲午夜视频在线观看| 一区二区三区毛片| 亚洲一区在线视频| 一区二区三区丝袜| 亚洲精品日韩一| 椎名由奈av一区二区三区| 国产精品欧美久久久久一区二区| 久久久久久电影| 欧美激情一区二区| 欧美激情一区在线| 自拍偷在线精品自拍偷无码专区| 亚洲天天做日日做天天谢日日欢| 综合网在线视频| 樱桃视频在线观看一区| 亚洲国产你懂的| 偷拍亚洲欧洲综合| 日韩av在线播放中文字幕| 蜜桃av一区二区三区| 国产一区福利在线| 粉嫩在线一区二区三区视频| 成人av在线播放网址| 91香蕉视频mp4| 精品视频在线看| 日韩视频免费观看高清完整版在线观看| 欧美日本韩国一区二区三区视频| 日韩一级免费观看| 国产亚洲综合av| 国产精品理伦片| 亚洲国产精品精华液网站| 日韩电影在线观看网站| 国产乱码精品1区2区3区| 成人午夜视频在线| 一本大道久久精品懂色aⅴ| 欧美日韩免费一区二区三区| 日韩欧美亚洲另类制服综合在线| 国产日韩高清在线| 亚洲精品美国一| 久久国产精品无码网站| 成人天堂资源www在线| 欧美午夜精品理论片a级按摩| 91精品婷婷国产综合久久竹菊| 久久色成人在线| 亚洲婷婷国产精品电影人久久| 丝袜诱惑亚洲看片| 成人高清av在线| 欧美日韩免费观看一区二区三区| 精品国产sm最大网站免费看| 亚洲女女做受ⅹxx高潮| 久久99精品久久久久久动态图| 91丨九色丨蝌蚪丨老版| 日韩免费高清av| 亚洲同性同志一二三专区| 麻豆成人免费电影| 色久综合一二码| 精品sm捆绑视频| 亚洲高清免费在线| 大桥未久av一区二区三区中文| 在线成人小视频| 1000精品久久久久久久久| 免费欧美在线视频| 欧美视频自拍偷拍| 国产女同性恋一区二区| 日韩和的一区二区| 欧美在线一区二区| 亚洲丝袜自拍清纯另类| 久久99精品国产麻豆不卡| 欧美日韩亚洲不卡| 亚洲欧美在线视频观看| 国产精品一级在线| 精品日韩99亚洲| 日韩av电影一区| 欧美视频日韩视频在线观看| 成人欧美一区二区三区| 国产激情视频一区二区三区欧美| 欧美一区国产二区| 亚洲一区二区成人在线观看| 97久久精品人人做人人爽50路| 久久亚洲综合av| 蜜臀精品一区二区三区在线观看| 欧美日韩日本视频| 一区二区三区免费看视频| 91视频在线观看| 国产欧美一区二区三区沐欲| 久久精品国产精品亚洲红杏| 欧美一卡2卡3卡4卡| 日韩av中文在线观看| 91精品啪在线观看国产60岁| 天堂va蜜桃一区二区三区 | 亚洲成av人**亚洲成av**| 欧亚一区二区三区| 亚洲一区二区三区四区在线观看| 欧美在线观看视频在线| 亚洲第一久久影院| 69精品人人人人|