<tfoot id='w4XuU'></tfoot>
  • <legend id='w4XuU'><style id='w4XuU'><dir id='w4XuU'><q id='w4XuU'></q></dir></style></legend>
      <bdo id='w4XuU'></bdo><ul id='w4XuU'></ul>

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

        <small id='w4XuU'></small><noframes id='w4XuU'>

        生成给定距离的坐标,距中心的角度

        时间:2023-08-08
          <bdo id='vG9sa'></bdo><ul id='vG9sa'></ul>

                  <tbody id='vG9sa'></tbody>
                <legend id='vG9sa'><style id='vG9sa'><dir id='vG9sa'><q id='vG9sa'></q></dir></style></legend>
              • <tfoot id='vG9sa'></tfoot>
                <i id='vG9sa'><tr id='vG9sa'><dt id='vG9sa'><q id='vG9sa'><span id='vG9sa'><b id='vG9sa'><form id='vG9sa'><ins id='vG9sa'></ins><ul id='vG9sa'></ul><sub id='vG9sa'></sub></form><legend id='vG9sa'></legend><bdo id='vG9sa'><pre id='vG9sa'><center id='vG9sa'></center></pre></bdo></b><th id='vG9sa'></th></span></q></dt></tr></i><div id='vG9sa'><tfoot id='vG9sa'></tfoot><dl id='vG9sa'><fieldset id='vG9sa'></fieldset></dl></div>

              • <small id='vG9sa'></small><noframes id='vG9sa'>

                  本文介绍了生成给定距离的坐标,距中心的角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在地图 [x1,y1] 中有一个给定的中心.从那个中心我画一个半径为 1 英里的圆.我需要在圆周围再生成 8 个点,各个点到中心的距离应该是 1 英里,所以它们在圆的边界上.我确实知道得到 x2, y2 的公式,但问题是它不适用于地球地图,因为它不是一个完美的球体.

                  I have a given center in the map [x1,y1]. From that center I am drawing a circle with a 1 mile radius. I need to generate 8 more points around the circle, the distance between the individual points to center should be 1 mile, so they are on the circle bounds. I do know the formulas to get x2, y2 but the problem is it doesn't apply to earth's map since it isn't a perfect sphere.

                  我尝试过使用 this,但没有成功.

                  I've tried using this, but with no luck.

                  谁能指出我的某个地方,或者我弄错了?

                  Could anyone point me somewhere or maybe I got this wrong ?

                  已解决!

                  所以仔细阅读整个 Movable Type Scripts 我发现了这个(为了我的使用稍微修改了):

                  So reading carefully throughout Movable Type Scripts I found this (slightly modified for my use):

                     let getPoint = (distance, bearing, center) => {
                  
                      let δ = Number(distance) / 6371e3; 
                      let θ = Number(bearing).toRadians();
                  
                      let φ1 = center[0].toRadians();
                      let λ1 = center[1].toRadians();
                  
                      let sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1);
                      let sinδ = Math.sin(δ), cosδ = Math.cos(δ);
                      let sinθ = Math.sin(θ), cosθ = Math.cos(θ);
                  
                      let sinφ2 = sinφ1*cosδ + cosφ1*sinδ*cosθ;
                      let φ2 = Math.asin(sinφ2);
                      let y = sinθ * sinδ * cosφ1;
                      let x = cosδ - sinφ1 * sinφ2;
                      let λ2 = λ1 + Math.atan2(y, x);
                  
                      return [φ2.toDegrees(), (λ2.toDegrees()+540)%360-180]; 
                  };
                  

                  它确实解决了我的问题.

                  It did solved my problem.

                  推荐答案

                  您正在尝试解决所谓的 第一个(或直接的)大地测量问题.知道这个名字会让你的研究更容易.

                  You are trying to solve what is known as the first (or direct) geodetic problem. Knowing this name will make your research easier.

                  正如如何使用 Leaflet" 和 "在给定起始坐标、方位角和距离的情况下查找目的地坐标",您在 javascript 中解决此问题的主要选项是 cheap-ruler 用于小(ish)区域和 greographiclib 适合远距离.

                  As pointed out by the answers to "How to draw polyline perpendicular to another polyline using Leaflet" and "Find destination coordinates given starting coodinates, bearing, and distance", your main options to approach this problem in javascript are cheap-ruler for small(ish) areas and greographiclib for large distances.

                  cheap-ruler 往往非常快但不准确,geographiclib 往往较慢但非常准确.

                  cheap-ruler tends to be very fast but inaccurate, and geographiclib tends to be slower but very accurate.

                  您可能会发现其他实现,每个都有自己的妥协.大地测量学很难,所以 没有一种真正的方法"来计算距离或方位角.

                  You might find other implementations, each with its own compromises. Geodesy is hard, so there is no "one true way" to calculate distances or azimuths.

                  这篇关于生成给定距离的坐标,距中心的角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用leaflet.js 在多个地图图例之间切换? 下一篇:传单圆圈绘图/编辑问题

                  相关文章

                  最新文章

                  <legend id='Sapvf'><style id='Sapvf'><dir id='Sapvf'><q id='Sapvf'></q></dir></style></legend>
                    <bdo id='Sapvf'></bdo><ul id='Sapvf'></ul>
                  <tfoot id='Sapvf'></tfoot>
                • <small id='Sapvf'></small><noframes id='Sapvf'>

                      <i id='Sapvf'><tr id='Sapvf'><dt id='Sapvf'><q id='Sapvf'><span id='Sapvf'><b id='Sapvf'><form id='Sapvf'><ins id='Sapvf'></ins><ul id='Sapvf'></ul><sub id='Sapvf'></sub></form><legend id='Sapvf'></legend><bdo id='Sapvf'><pre id='Sapvf'><center id='Sapvf'></center></pre></bdo></b><th id='Sapvf'></th></span></q></dt></tr></i><div id='Sapvf'><tfoot id='Sapvf'></tfoot><dl id='Sapvf'><fieldset id='Sapvf'></fieldset></dl></div>