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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gpsfuncs.c

?? C寫的用軟件無線電實現的GPS模擬程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* ************************************************************************    *                                                                      *   *                          GPS Simulation                              *   *                                                                      *   * -------------------------------------------------------------------- *   *                                                                      *   *    Module:   gpsfuncs.c                                              *   *                                                                      *   *   Version:   0.1                                                     *   *                                                                      *   *      Date:   17.02.02                                                *   *                                                                      *   *    Author:   G. Beyerle                                              *   *                                                                      *   * -------------------------------------------------------------------- *   *                                                                      *   * Copyright (c) 1996-2001 Clifford Kelley.  All Rights Reserved.       *   * Copyright (C) 2002-2006 Georg Beyerle                                *   *                                                                      *   * This program is free software; you can redistribute it and/or modify *   * it under the terms of the GNU General Public License as published by *   * the Free Software Foundation; either version 2 of the License, or    *   * (at your option) any later version.                                  *   *                                                                      *   * This program is distributed in the hope that it will be useful,      *   * but WITHOUT ANY WARRANTY; without even the implied warranty of       *   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *   * GNU General Public License for more details.                         *   *                                                                      *   * You should have received a copy of the GNU General Public License    *   * along with this program; if not, write to the Free Software          *   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            *   *                                                                      *   * -------------------------------------------------------------------- *   *                                                                      *   * The files 'gpsfuncs.cpp', 'gpsrcvr.cpp' and 'gp2021.cpp' are modi-   *   * fied versions of the files with the same name from Clifford Kelley's *    * OpenSourceGPS distribution. The unmodified files can be obtained     *   * from http://www.home.earthlink.net/~cwkelley                         *   *                                                                      *   * -------------------------------------------------------------------- *   *                                                                      *   *                                GPS receiver                          *   *                                                                      *   ************************************************************************ *//* ******************************* changes ********************************   dd.mm.yy -   ************************************************************************ *//***********************************************************************  GPS RECEIVER (GPSRCVR) Ver. 1.02  12 Channel All-in-View GPS Receiver Program based on Mitel GP2021  chipset  Clifford Kelley cwkelley@earthlink.net  Copyright (c) 1996-2001 Clifford Kelley.  All Rights Reserved.  This LICENSE must be included with the GPSRCVR code.***********************************************************************//*Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions aremet:      CONDITIONS1. Redistributions of GPSRCVR source code must retain the above copyrightnotice, this list of conditions, and the following disclaimer.2. Redistributions in binary form must contain the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.3. All modifications to the source code must be clearly marked assuch.  Binary redistributions based on modified source code must beclearly marked as modified versions in the documentation and/or othermaterials provided with the distribution.4. Notice must be given of the location of the availability of theunmodified current source code, e.g.,  http://www.Kelley.com/or  ftp://ftp.Kelley.comin the documentation and/or other materials provided with thedistribution.5. All advertising and published materials mentioning features or useof this software must display the following acknowledgment:  "Thisproduct includes software developed by Clifford Kelley and othercontributors."6. The name of Clifford Kelley may not be used to endorse or promoteproducts derived from this software without specific prior writtenpermission.      DISCLAIMERThis software is provided by Clifford Kelley and contributors "as is" andany expressed or implied warranties, including, but not limited to, theimplied warranties of merchantability and fitness for a particularpurpose are disclaimed.  In no event shall Clifford Kelley orcontributors be liable for any direct, indirect, incidental, special,exemplary, or consequential damages (including, but not limited to,procurement of substitute goods or services; loss of use, data, orprofits; or business interruption) however caused and on any theory ofliability, whether in contract, strict liability, or tort (includingnegligence or otherwise) arising in any way out of the use of thissoftware, even if advised of the possibility of such damage.*//* ------------------------------- includes -------------------------------- */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <math.h>#ifndef linux# include <io.h>#endif#include "ogsdefine.h"#include "ogsstructs.h"#include "ogsextern.h"#include "ogsprototypes.h"#include "ogslibrary.h"/* ------------------------------ prototypes -------------------------------- */int matherr (struct exception *a);/* ------------------------------- globals ---------------------------------- */extern time_t thetime;/* ------------------------------ functions --------------------------------- *//*******************************************************************************FUNCTION bit_test_l()RETURNS  intPARAMETERS    Data    bit_nPURPOSE  This function returns a 1 if bit number bit_n of long Data is set  else it returns a 0WRITTEN BY  Clifford Kelley*******************************************************************************/inline int  bit_test_l( unsigned long data, char bit_n){  int result;  result = 0;  if (data & test_l[bit_n])    result = 1;  return result;}/*******************************************************************************FUNCTION satfind()RETURNS  None.PARAMETERS None.PURPOSE  THIS FUNCTION DETERMINES THE SATELLITES TO SEARCH FOR  WHEN ALMANAC DATA IS AVAILABLEWRITTEN BY  Clifford Kelley*******************************************************************************/SATVIS satfind( char i){  float   ralt, tdot, b, az;  float   satang, alm_time, almanac_date;  double  range1, range2, xls, yls, zls, xaz, yaz, xn, yn, zn, xe, ye;  long    jd_yr;  ECEF    gpspos1, gpspos2;  SATVIS  result;  int     jd_m;  struct tm *gmt;  double  time_s;  static int justonce = 1;/*      INITIALIZE ALL THE CONSTANTS*/  putenv( tzstr);  tzset();//  thetime = time( NULL);          // *** CHECKME ***  thetime = 1015302770L;  if ( justonce)  {    printf("*** set time to 1015302770 ***\n");    justonce = 0;  }        gmt = gmtime( &thetime);// set up the correct time  if (gmt->tm_mon <= 1)  {    jd_yr = (long)( 365.25 * (gmt->tm_year - 1. + 1900.));  // GB: (long)() inserted    jd_m  = (int)( 30.6001 * (gmt->tm_mon+14.));            // GB: (int)() inserted  }  else  {    jd_yr = (long)( 365.25 * (gmt->tm_year + 1900.));    jd_m  = (int)( 30.6001 * (gmt->tm_mon+2.));  }  time_s = gmt->tm_hour/24. + gmt->tm_min/1440. + gmt->tm_sec/86400. +            1720981.5 + jd_yr + jd_m + gmt->tm_mday;  gps_week     = (int)((time_s - 2444244.5)/7.);  almanac_date = gps_alm[i].week * 7.0 + 2444244.5;  if ( gps_week - gps_alm[i].week > 512)     almanac_date += 1024*7.0;  alm_time  = (time_s - almanac_date) * 86400.;  clock_tow = (long) ((time_s - gps_week*7. - 2444244.5) * 86400.); // GB: inserted cast/*      CALCULATE THE POSITION OF THE SATELLITES*/  if (gps_alm[i].inc > 0.0 && i>0)  {    gpspos1 = satpos_almanac( alm_time,i);    gpspos2 = satpos_almanac( alm_time+60.0,i);/*      CALCULATE THE POSITION OF THE RECEIVER*/    rec_pos_xyz = llh_to_ecef(current_loc);    xn  = -cos( current_loc.lon)*sin( current_loc.lat);    yn  = -sin( current_loc.lon)*sin( current_loc.lat);    zn  =  cos( current_loc.lat);    xe  = -sin( current_loc.lon);    ye  =  cos( current_loc.lon);/*     DETERMINE IF A CLEAR LINE OF SIGHT EXISTS*/    xls  = gpspos1.x - rec_pos_xyz.x;    yls  = gpspos1.y - rec_pos_xyz.y;    zls  = gpspos1.z - rec_pos_xyz.z;    range1 = sqrt(xls*xls+yls*yls+zls*zls);    ralt = sqrt( rec_pos_xyz.x * rec_pos_xyz.x +                  rec_pos_xyz.y * rec_pos_xyz.y +                  rec_pos_xyz.z * rec_pos_xyz.z);    tdot = ( rec_pos_xyz.x * xls +              rec_pos_xyz.y * yls +              rec_pos_xyz.z * zls) / range1 / ralt;    xls  = xls / range1;    yls  = yls / range1;    zls  = zls / range1;//    range2 = sqrt( pow( gpspos2.x - rec_pos_xyz.x, 2) + //                   pow( gpspos2.y - rec_pos_xyz.y, 2) +//                   pow( gpspos2.z - rec_pos_xyz.z, 2));    if ( tdot >= 1.00 )      b = 0.0;    else if ( tdot <= -1.00 )      b = pi;    else      b = acos( tdot);    satang = pi/2.0 - b;    xaz    = xe*xls + ye*yls;    yaz    = xn*xls + yn*yls + zn*zls;    if ( xaz != 0.0 || yaz != 0.0)       az = atan2( xaz, yaz);    else       az = 0.0;    result.x = gpspos1.x;    result.y = gpspos1.y;    result.z = gpspos1.z;    result.elevation = satang;    result.azimuth   = az;//    result.doppler   = (range1-range2) * 5.2514 / 60.;    result.doppler   = 0.;                                  // *** CHECKME ***    static int JustOnce = 1;    if ( JustOnce)    {      printf("sat_find: *** set doppler to zero! ***\n");      JustOnce = 0;    }  //    getchar();  }  return result;}/*******************************************************************************FUNCTION satpos_almanac()RETURNS  None.PARAMETERS None.PURPOSE     THIS SUBROUTINE CALCULATES THE SATELLITE POSITION     BASED ON ALMANAC DATA         R    - RADIUS OF SATELLITE AT TIME T     SLAT - SATELLITE LATITUDE     SLONG- SATELLITE LONGITUDE     T    - TIME FROM START OF WEEKLY EPOCH     ETY  - ORBITAL ECCENTRICITY     TOA  - TIME OF APPLICABILITY FROM START OF WEEKLY EPOCH     INC  - ORBITAL INCLINATION     RRA  - RATE OF RIGHT ASCENSION    SQA  - SQUARE ROOT OF SEMIMAJOR AXIS     LAN  - LONGITUDE OF NODE AT WEEKLY EPOCH     AOP  - ARGUMENT OF PERIGEE    MA   - MEAN ANOMALY AT TOAWRITTEN BY  Clifford Kelley******************************************************************************/ECEF satpos_almanac( float time, char n){  double ei,ea,diff,r,ta,la,aol,xp,yp,d_toa;  ECEF result;/*      MA IS THE ANGLE FROM PERIGEE AT TOA*/  d_toa=time-gps_alm[n].toa;  if ( d_toa > 302400.0)     d_toa = d_toa - 604800.0;  ei = gps_alm[n].ma + d_toa * gps_alm[n].w;  ea = ei;  do  {    diff = (ei-(ea-gps_alm[n].ety*sin(ea)))/(1.-gps_alm[n].ety*cos(ea));    ea   = ea+diff;  } while ( fabs( diff) > 1.0e-6);/*      EA IS THE ECCENTRIC ANOMALY*/  if ( gps_alm[n].ety != 0.0 )    ta = atan2( sqrt(1. - pow(gps_alm[n].ety,2))*sin(ea),cos(ea)-gps_alm[n].ety);  else    ta = ea;/*      TA IS THE TRUE ANOMALY (ANGLE FROM PERIGEE)*/  r = pow( gps_alm[n].sqra,2)*(1.-pow(gps_alm[n].ety,2)*cos(ea));/*      R IS THE RADIUS OF SATELLITE ORBIT AT TIME T*/  aol = ta + gps_alm[n].w;/*    AOL IS THE ARGUMENT OF LATITUDE    LA IS THE LONGITUDE OF THE ASCENDING NODE*/  la = gps_alm[n].omega0 + (gps_alm[n].omegadot-omegae) * d_toa - gps_alm[n].toa * omegae;  xp = r*cos(aol);  yp = r*sin(aol);  result.x = xp*cos(la) - yp*cos(gps_alm[n].inc)*sin(la);  result.y = xp*sin(la) + yp*cos(gps_alm[n].inc)*cos(la);  result.z = yp*sin(gps_alm[n].inc);  return result;}/*******************************************************************************FUNCTION satpos_ephemeris()RETURNS  None.PARAMETERS None.PURPOSE     THIS SUBROUTINE CALCULATES THE SATELLITE POSITION     BASED ON BROADCAST EPHEMERIS DATA     R    - RADIUS OF SATELLITE AT TIME T     Crc  - RADIUS COSINE CORRECTION TERM     Crs  - RADIUS SINE   CORRECTION TERM     SLAT - SATELLITE LATITUDE     SLONG- SATELLITE LONGITUDE     TOE  - TIME OF EPHEMERIS FROM START OF WEEKLY EPOCH     ETY  - ORBITAL INITIAL ECCENTRICITY     TOA  - TIME OF APPLICABILITY FROM START OF WEEKLY EPOCH     INC  - ORBITAL INCLINATION     IDOT - RATE OF INCLINATION ANGLE     CUC  - ARGUMENT OF LATITUDE COSINE CORRECTION TERM     CUS  - ARGUMENT OF LATITUDE SINE   CORRECTION TERM     CIC  - INCLINATION COSINE CORRECTION TERM     CIS  - INCLINATION SINE   CORRECTION TERM     RRA  - RATE OF RIGHT ASCENSION     SQA  - SQUARE ROOT OF SEMIMAJOR AXIS     LAN  - LONGITUDE OF NODE AT WEEKLY EPOCH     AOP  - ARGUMENT OF PERIGEE     MA   - MEAN ANOMALY AT TOA     DN   - MEAN MOTION DIFFERENCEWRITTEN BY  Clifford Kelley

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线播放三区| 国产一区二区三区不卡在线观看| 91蜜桃网址入口| 亚洲品质自拍视频| 欧美日韩精品系列| 久久国产夜色精品鲁鲁99| 久久这里只有精品首页| 国产iv一区二区三区| 亚洲欧美一区二区三区国产精品| 色婷婷久久综合| 热久久一区二区| 久久久99精品久久| 99久久99久久精品国产片果冻| 亚洲人午夜精品天堂一二香蕉| 欧美视频一区在线观看| 蜜桃av噜噜一区二区三区小说| 国产欧美一区二区精品性| 色综合久久久久综合99| 日本欧美韩国一区三区| 国产精品视频一二| 国产成人精品三级| 中文字幕亚洲视频| 精品婷婷伊人一区三区三| 麻豆一区二区三区| 国产精品色在线| 欧美日韩亚洲综合| 国产91高潮流白浆在线麻豆| 亚洲影视资源网| 久久久久久久国产精品影院| 91国产成人在线| 国产乱子伦视频一区二区三区 | 国产高清无密码一区二区三区| 中文字幕在线一区免费| 欧美一级淫片007| 色老头久久综合| 国产剧情av麻豆香蕉精品| 亚洲自拍偷拍欧美| 国产日韩欧美精品在线| 欧美日韩国产精选| 97久久精品人人爽人人爽蜜臀| 麻豆成人在线观看| 亚洲成人一区在线| 99久久er热在这里只有精品15 | 又紧又大又爽精品一区二区| 日韩欧美亚洲国产精品字幕久久久 | 亚洲午夜在线视频| 欧美国产精品一区| 精品毛片乱码1区2区3区| 欧美午夜片在线看| 色综合天天综合狠狠| 国产在线日韩欧美| 免费在线观看一区二区三区| 亚洲专区一二三| 国产精品无码永久免费888| 日韩一二三区视频| 欧美日韩的一区二区| 色噜噜狠狠一区二区三区果冻| 国产成人综合在线观看| 激情综合网av| 久久99精品国产.久久久久| 欧美日韩精品一区二区在线播放| 一区二区三区在线观看国产| 国产午夜精品理论片a级大结局 | 夜夜嗨av一区二区三区网页 | 亚洲三级电影网站| 中文字幕在线一区二区三区| 日本一区二区三区在线不卡| www成人在线观看| 精品伦理精品一区| 欧美成人精品3d动漫h| 日韩精品资源二区在线| 欧美大白屁股肥臀xxxxxx| 日韩一区二区在线免费观看| 欧美日韩高清一区二区不卡| 欧美日韩中字一区| 欧美一区二区高清| 日韩精品中文字幕一区| 精品国产乱码久久久久久闺蜜| 欧美一卡二卡三卡| 久久综合九色综合97_久久久| 久久―日本道色综合久久| ww亚洲ww在线观看国产| 亚洲国产精品ⅴa在线观看| 同产精品九九九| 亚洲一区二区三区四区中文字幕| 亚洲欧美成人一区二区三区| 亚洲视频一区在线| 亚洲五码中文字幕| 日韩成人精品在线| 美国三级日本三级久久99 | 国产精品综合一区二区| 国产一区二区成人久久免费影院| 国产不卡一区视频| 色婷婷综合久久久中文一区二区| 色欧美88888久久久久久影院| 欧美影片第一页| 欧美一区二区三区播放老司机| 久久综合给合久久狠狠狠97色69| 国产午夜亚洲精品不卡| 一区二区三区中文字幕精品精品 | 亚洲午夜影视影院在线观看| 美日韩一区二区| 成人av动漫在线| 欧美日韩在线免费视频| 欧美一区二区三区小说| 国产欧美日韩卡一| 亚洲精品日韩一| 精品中文字幕一区二区小辣椒| 懂色av噜噜一区二区三区av| 欧美亚洲日本一区| 精品国产乱码久久久久久久| 亚洲老妇xxxxxx| 国产在线不卡一区| 欧美色爱综合网| 久久亚洲影视婷婷| 亚洲一区在线电影| 国产成人在线视频网站| 欧美写真视频网站| 日本一区二区综合亚洲| 天天综合色天天| 成人精品gif动图一区| 欧美美女喷水视频| 国产精品盗摄一区二区三区| 美女网站一区二区| 欧美亚洲自拍偷拍| 亚洲国产成人一区二区三区| 日韩精品免费专区| 一本色道久久综合精品竹菊 | 中文字幕欧美日本乱码一线二线 | 久久久精品日韩欧美| 亚洲国产精品人人做人人爽| 国产999精品久久久久久| 欧美人xxxx| 国产精品国产精品国产专区不片| 麻豆国产一区二区| 欧美日韩亚洲综合一区| ●精品国产综合乱码久久久久| 久久国产精品免费| 91精品在线观看入口| 亚洲视频一二区| 粉嫩一区二区三区在线看| 欧美一区在线视频| 亚洲一区av在线| 91蜜桃在线免费视频| 国产清纯在线一区二区www| 蜜桃精品视频在线| 51久久夜色精品国产麻豆| 亚洲一区二区在线免费观看视频| 99久久久久久| 国产精品美女www爽爽爽| 国产伦理精品不卡| 久久这里只精品最新地址| 蜜臀av性久久久久蜜臀aⅴ流畅 | 精品国产91乱码一区二区三区| 亚洲一二三区视频在线观看| 99国产精品久久| 国产精品久久久久久久久快鸭 | 午夜电影网一区| 欧美午夜一区二区三区| 亚洲一级电影视频| 欧美性受极品xxxx喷水| 亚洲资源在线观看| 欧美日韩精品福利| 首页亚洲欧美制服丝腿| 欧美天堂一区二区三区| 午夜精品久久久久久久| 欧美精品日韩一区| 日本成人在线不卡视频| 91精品国产综合久久久久久久| 亚洲福利国产精品| 欧美美女黄视频| 久久不见久久见免费视频1| 久久综合五月天婷婷伊人| 国产一区二区三区四区在线观看| 精品国产不卡一区二区三区| 国产福利91精品一区| 国产精品久久久久久福利一牛影视| av电影在线观看不卡| 一区二区三区丝袜| 欧美精品日日鲁夜夜添| 久久精工是国产品牌吗| 久久久高清一区二区三区| 国产mv日韩mv欧美| 亚洲精品国产a| 日韩午夜激情免费电影| 激情综合网最新| 成人免费在线观看入口| 欧美视频日韩视频在线观看| 日韩电影免费在线| 久久精品视频免费| 在线观看日韩电影| 蜜桃91丨九色丨蝌蚪91桃色| 日本一区二区三区在线观看| 色八戒一区二区三区| 男女男精品网站| 国产精品白丝在线| 日韩一区二区影院| 成人免费高清在线| 天天色综合天天| 国产精品成人免费精品自在线观看|