久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='PSlzR'></tfoot>

    1. <i id='PSlzR'><tr id='PSlzR'><dt id='PSlzR'><q id='PSlzR'><span id='PSlzR'><b id='PSlzR'><form id='PSlzR'><ins id='PSlzR'></ins><ul id='PSlzR'></ul><sub id='PSlzR'></sub></form><legend id='PSlzR'></legend><bdo id='PSlzR'><pre id='PSlzR'><center id='PSlzR'></center></pre></bdo></b><th id='PSlzR'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PSlzR'><tfoot id='PSlzR'></tfoot><dl id='PSlzR'><fieldset id='PSlzR'></fieldset></dl></div>

        <bdo id='PSlzR'></bdo><ul id='PSlzR'></ul>
    2. <small id='PSlzR'></small><noframes id='PSlzR'>

      <legend id='PSlzR'><style id='PSlzR'><dir id='PSlzR'><q id='PSlzR'></q></dir></style></legend>
      1. 計(jì)算距離一個(gè)坐標(biāo)的新坐標(biāo) x 米和 y 度

        Calculate new coordinate x meters and y degree away from one coordinate(計(jì)算距離一個(gè)坐標(biāo)的新坐標(biāo) x 米和 y 度)

      2. <small id='LA24B'></small><noframes id='LA24B'>

            <tbody id='LA24B'></tbody>
            1. <legend id='LA24B'><style id='LA24B'><dir id='LA24B'><q id='LA24B'></q></dir></style></legend>
              1. <tfoot id='LA24B'></tfoot>
                <i id='LA24B'><tr id='LA24B'><dt id='LA24B'><q id='LA24B'><span id='LA24B'><b id='LA24B'><form id='LA24B'><ins id='LA24B'></ins><ul id='LA24B'></ul><sub id='LA24B'></sub></form><legend id='LA24B'></legend><bdo id='LA24B'><pre id='LA24B'><center id='LA24B'></center></pre></bdo></b><th id='LA24B'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LA24B'><tfoot id='LA24B'></tfoot><dl id='LA24B'><fieldset id='LA24B'></fieldset></dl></div>
                  <bdo id='LA24B'></bdo><ul id='LA24B'></ul>
                  本文介紹了計(jì)算距離一個(gè)坐標(biāo)的新坐標(biāo) x 米和 y 度的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我一定是在文檔中遺漏了一些東西,我認(rèn)為這應(yīng)該很容易......

                  I must be missing somthing out in the docs, I thought this should be easy...

                  如果我有一個(gè)坐標(biāo)并且想要在 x 米外的某個(gè)方向上獲得一個(gè)新坐標(biāo).我該怎么做?

                  If I have one coordinate and want to get a new coordinate x meters away, in some direction. How do I do this?

                  我正在尋找類似的東西

                  -(CLLocationCoordinate2D) translateCoordinate:(CLLocationCoordinate2D)坐標(biāo)translateMeters:(int) 米translateDegrees:(double)degrees;

                  謝謝!

                  推薦答案

                  很遺憾,API 中沒有提供這樣的功能,所以你必須自己編寫.

                  Unfortunately, there's no such function provided in the API, so you'll have to write your own.

                  這個(gè)網(wǎng)站給出了幾個(gè)涉及緯度/經(jīng)度和樣本的計(jì)算JavaScript 代碼.具體來說,標(biāo)題為給定距離起點(diǎn)的目標(biāo)點(diǎn)和方位角"的部分顯示了如何計(jì)算您的要求.

                  This site gives several calculations involving latitude/longitude and sample JavaScript code. Specifically, the section titled "Destination point given distance and bearing from start point" shows how to calculate what you're asking.

                  JavaScript 代碼位于該頁面的底部,這是將其轉(zhuǎn)換為 Objective-C 的一種可能方法:

                  The JavaScript code is at the bottom of that page and here's one possible way to convert it to Objective-C:

                  - (double)radiansFromDegrees:(double)degrees
                  {
                      return degrees * (M_PI/180.0);    
                  }
                  
                  - (double)degreesFromRadians:(double)radians
                  {
                      return radians * (180.0/M_PI);
                  }
                  
                  - (CLLocationCoordinate2D)coordinateFromCoord:
                          (CLLocationCoordinate2D)fromCoord 
                          atDistanceKm:(double)distanceKm 
                          atBearingDegrees:(double)bearingDegrees
                  {
                      double distanceRadians = distanceKm / 6371.0;
                        //6,371 = Earth's radius in km
                      double bearingRadians = [self radiansFromDegrees:bearingDegrees];
                      double fromLatRadians = [self radiansFromDegrees:fromCoord.latitude];
                      double fromLonRadians = [self radiansFromDegrees:fromCoord.longitude];
                  
                      double toLatRadians = asin( sin(fromLatRadians) * cos(distanceRadians) 
                          + cos(fromLatRadians) * sin(distanceRadians) * cos(bearingRadians) );
                  
                      double toLonRadians = fromLonRadians + atan2(sin(bearingRadians) 
                          * sin(distanceRadians) * cos(fromLatRadians), cos(distanceRadians) 
                          - sin(fromLatRadians) * sin(toLatRadians));
                  
                      // adjust toLonRadians to be in the range -180 to +180...
                      toLonRadians = fmod((toLonRadians + 3*M_PI), (2*M_PI)) - M_PI;
                  
                      CLLocationCoordinate2D result;
                      result.latitude = [self degreesFromRadians:toLatRadians];
                      result.longitude = [self degreesFromRadians:toLonRadians];
                      return result;
                  }
                  

                  在 JS 代碼中,它包含 這個(gè)鏈接 顯示更準(zhǔn)確的計(jì)算距離大于地球周長的 1/4.

                  In the JS code, it contains this link which shows a more accurate calculation for distances greater than 1/4 of the Earth's circumference.

                  另請注意,上述代碼接受以公里為單位的距離,因此請務(wù)必在通過之前將米除以 1000.0.

                  Also note the above code accepts distance in km so be sure to divide meters by 1000.0 before passing.

                  這篇關(guān)于計(jì)算距離一個(gè)坐標(biāo)的新坐標(biāo) x 米和 y 度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經(jīng)度計(jì)算 X 和 Y)
                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  CLLocation returning negative speed(CLLocation 返回負(fù)速度)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                    <tbody id='H6td8'></tbody>

                  <legend id='H6td8'><style id='H6td8'><dir id='H6td8'><q id='H6td8'></q></dir></style></legend>

                      <i id='H6td8'><tr id='H6td8'><dt id='H6td8'><q id='H6td8'><span id='H6td8'><b id='H6td8'><form id='H6td8'><ins id='H6td8'></ins><ul id='H6td8'></ul><sub id='H6td8'></sub></form><legend id='H6td8'></legend><bdo id='H6td8'><pre id='H6td8'><center id='H6td8'></center></pre></bdo></b><th id='H6td8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='H6td8'><tfoot id='H6td8'></tfoot><dl id='H6td8'><fieldset id='H6td8'></fieldset></dl></div>
                    1. <small id='H6td8'></small><noframes id='H6td8'>

                        • <tfoot id='H6td8'></tfoot>
                          • <bdo id='H6td8'></bdo><ul id='H6td8'></ul>

                          • 主站蜘蛛池模板: 久草资源在线 | 天天搞天天干 | av免费看网站 | 久久久久久网 | 午夜免费网站 | 国产精品入口夜色视频大尺度 | 全部免费毛片在线播放高潮 | 涩涩视频免费观看 | 欧美日韩免费一区二区三区 | 天天躁日日躁bbbbb | 久久久久久亚洲 | 国产一区福利 | 国产v片 | 在线日韩欧美 | 一极黄色片| 中文毛片| 免费一级黄色片 | 一级片aa | 日本免费一级片 | 麻豆91在线 | 欧美日韩在线观看一区二区 | 欧美视频在线观看 | 深夜福利视频在线观看 | www.亚洲国产| 黄色av大片 | 亚洲黄色免费 | 在线视频黄 | 亚洲国产二区 | 亚洲福利网 | 国产不卡视频 | 欧美日韩三级 | 成人午夜视频在线观看 | 黄色小视频免费观看 | 欧美日韩一区二区在线观看 | 精品日韩在线 | 国产一区二区三区精品视频 | 国产精品一区二区三区四区 | 精品久久影院 | 国产成人在线播放 | 涩涩999| 久久黄色|