久久久久久久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. 計算距離一個坐標的新坐標 x 米和 y 度

        Calculate new coordinate x meters and y degree away from one coordinate(計算距離一個坐標的新坐標 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>
                  本文介紹了計算距離一個坐標的新坐標 x 米和 y 度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我一定是在文檔中遺漏了一些東西,我認為這應該很容易......

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

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

                  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)坐標translateMeters:(int) 米translateDegrees:(double)degrees;

                  謝謝!

                  推薦答案

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

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

                  這個網站給出了幾個涉及緯度/經度和樣本的計算JavaScript 代碼.具體來說,標題為給定距離起點的目標點和方位角"的部分顯示了如何計算您的要求.

                  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 代碼位于該頁面的底部,這是將其轉換為 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 代碼中,它包含 這個鏈接 顯示更準確的計算距離大于地球周長的 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.

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

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

                  這篇關于計算距離一個坐標的新坐標 x 米和 y 度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經度計算 X 和 Y)
                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  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 返回負速度)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                    <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>

                          • 主站蜘蛛池模板: 国产精品日产欧美久久久久 | 亚洲一二三区不卡 | www亚洲精品 | 日韩三级电影一区二区 | 精品不卡 | 国产黄色小视频在线观看 | 欧美亚洲视频在线观看 | 玖玖玖在线 | 亚洲高清久久 | 国产一区二区三区精品久久久 | 亚洲精品在线视频 | 国产日产精品一区二区三区四区 | 性做久久久久久免费观看欧美 | 亚洲国产一区二区三区四区 | 日韩欧美国产精品一区二区三区 | 色综合天天天天做夜夜夜夜做 | 天天综合成人网 | 免费国产视频 | 黄频免费 | 国产精品久久久久久久久久久久久 | 成人免费激情视频 | 亚洲一区 中文字幕 | 日韩电影中文字幕在线观看 | 亚洲美女在线一区 | 亚洲美女网站 | 中文字幕乱码一区二区三区 | 亚洲国产精品一区二区久久 | av不卡一区 | 91精品国产高清一区二区三区 | 国产探花在线精品一区二区 | 日韩三级在线观看 | 性高湖久久久久久久久 | 国产精品伦一区二区三级视频 | 国产精品久久久久久久免费观看 | 午夜二区| 91精品国产色综合久久不卡蜜臀 | 草久久 | 亚洲啪啪 | 国产专区视频 | 欧美a√ | 久久精品视频亚洲 |