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

<legend id='8BUJK'><style id='8BUJK'><dir id='8BUJK'><q id='8BUJK'></q></dir></style></legend>
  • <small id='8BUJK'></small><noframes id='8BUJK'>

    <tfoot id='8BUJK'></tfoot>

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

      1. 沿兩點之間的直線獲取緯度和經度點,按百分比

        Get latitude and longitude points along a line between two points, by percentage(沿兩點之間的直線獲取緯度和經度點,按百分比)

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

            <tfoot id='PkXD6'></tfoot>
              <tbody id='PkXD6'></tbody>

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

                <i id='PkXD6'><tr id='PkXD6'><dt id='PkXD6'><q id='PkXD6'><span id='PkXD6'><b id='PkXD6'><form id='PkXD6'><ins id='PkXD6'></ins><ul id='PkXD6'></ul><sub id='PkXD6'></sub></form><legend id='PkXD6'></legend><bdo id='PkXD6'><pre id='PkXD6'><center id='PkXD6'></center></pre></bdo></b><th id='PkXD6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PkXD6'><tfoot id='PkXD6'></tfoot><dl id='PkXD6'><fieldset id='PkXD6'></fieldset></dl></div>
                  本文介紹了沿兩點之間的直線獲取緯度和經度點,按百分比的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在下圖中,您可以看到從一個點(黑色圓圈)到它的三個相關點()繪制了 3 條線.

                  圖片

                  問題

                  如何計算沿每條線的點之間的經緯度點,使用兩點之間距離的百分比?

                  例如,如果我想讓位置能夠沿著每條線繪制額外的圓,相差 20%?

                  我現在有什么代碼

                  var 數據 = [{坐標":[53.409045,-2.985406]},{坐標":[53.408747,-2.982862]},{坐標":[53.407630,-2.984136]},{坐標":[53.407142,-2.986931]}];var pointA = new L.LatLng(53.409045, -2.985406);變量點B;data.forEach(函數(d){pointB = new L.LatLng(d.coords[0], d.coords[1]);L.polyline([pointA, pointB]).addTo(map);L.circle([d.coords[0], d.coords[1]], 10).addTo(map);});

                  上面的代碼唯一要做的就是為每個點畫一個圓,并從主圓(pointA)到其他圓(pointB)畫一條線

                  我非常需要知道如何按距離百分比計算 pointA 與其相關點之間的多個坐標.

                  我需要確保所有綠色圓圈與中心圓圈的距離相同

                  要測試的代碼

                  解決方案

                  警告:這適用于線性坐標.正如 Ollie Jones 所提到的,雖然這對于短距離(或在某些情況下取決于您的投影)是一個合理的近似值,但對于長距離或如果您想要一個非常準確的百分比點,這將不起作用

                  您要查找的函數是 pointAtPercent.紅色是起點(你的中心圓圈),綠色是終點(你的終點圓圈)

                  var ctx = document.getElementById("myChart").getContext("2d");函數drawPoint(顏色,點){ctx.fillStyle = 顏色;ctx.beginPath();ctx.arc(point.x, point.y, 5, 0, 2 * Math.PI, false);ctx.fill();}函數畫線(點1,點2){ctx.strokeStyle = '灰色';ctx.setLineDash([5, 5]);ctx.beginPath();ctx.moveTo(point1.x, point1.y);ctx.lineTo(point2.x, point2.y);ctx.stroke();}功能點AtPercent(p0,p1,百分比){drawPoint('紅色', p0);drawPoint('綠色', p1);畫線(p0,p1);變量 x;如果 (p0.x !== p1.x)x = p0.x + 百分比 * (p1.x - p0.x);別的x = p0.x;各不相同;如果 (p0.y !== p1.y)y = p0.y + 百分比 * (p1.y - p0.y);別的y = p0.y;變種 p = {x: x,是的:是的};drawPoint('藍色', p);返回 p;}pointAtPercent({ x: 50, y: 25 }, { x: 200, y: 300 }, 0.2)pointAtPercent({ x: 150, y: 25 }, { x: 300, y: 100 }, 0.6)pointAtPercent({ x: 650, y: 300 }, { x: 100, y: 400 }, 0.4)

                  <小時>

                  小提琴 - https://jsfiddle.net/goev47aL/

                  In the image below, you can see that there 3 lines drawn from one point (the black circle) to its 3 related points ().

                  IMAGE

                  QUESTION

                  How to calculate latitude and longitude point between points along each line, using a percentage of the distance between the two points?

                  For example, if I wanted to get the position to be able to draw additional circles along each line with a 20% difference?

                  WHAT CODE I HAVE NOW

                  var data = [
                    { "coords" : [ 53.409045, -2.985406 ]},
                    { "coords" : [ 53.408747, -2.982862 ]},
                    { "coords" : [ 53.407630, -2.984136 ]},
                    { "coords" : [ 53.407142, -2.986931 ]}
                  ];
                  
                  
                  var pointA = new L.LatLng(53.409045, -2.985406);
                  var pointB; 
                  
                  data.forEach(function(d) {
                    pointB = new L.LatLng(d.coords[0], d.coords[1]);
                    L.polyline([pointA, pointB]).addTo(map);
                    L.circle([d.coords[0], d.coords[1]], 10).addTo(map);
                  });
                  

                  The only things the code above is doing is drawing a circle for each point and a line from the main circle (pointA) to the other circles (pointB)

                  I pretty much need to know how to calculate multiple coordinates, by percentage of distance, between the pointA and and its related points.

                  I need to make sure all green circle are the same distance from the center circle

                  CODEPEN TO TEST WITH

                  Codepen Link

                  EDIT - IMAGES OF WHAT i HAVE SO FAR USING THE CORRECT ANSWER BELOW

                  解決方案

                  Warning : this works on a linear coordinates. As Ollie Jones mentioned, while this is a reasonable approximation for short distances (or for certain cases depending on your projection), this won't work for long distance or if you want a very accurate point at percent

                  The function you are looking for is pointAtPercent. Red is the start point (your center circle) and green the end point (your end circles)

                  var ctx = document.getElementById("myChart").getContext("2d");
                  
                  function drawPoint(color, point) {
                      ctx.fillStyle = color;
                      ctx.beginPath();
                      ctx.arc(point.x, point.y, 5, 0, 2 * Math.PI, false);
                      ctx.fill();
                  }
                  
                  function drawLine(point1, point2) {
                      ctx.strokeStyle = 'gray';
                      ctx.setLineDash([5, 5]);    
                      ctx.beginPath();
                      ctx.moveTo(point1.x, point1.y);
                      ctx.lineTo(point2.x, point2.y);
                      ctx.stroke();    
                  }
                  
                  
                  function pointAtPercent(p0, p1, percent) {
                      drawPoint('red', p0);
                      drawPoint('green', p1);
                      drawLine(p0, p1);
                  
                      var x;
                      if (p0.x !== p1.x)
                          x = p0.x + percent * (p1.x - p0.x);
                      else
                          x = p0.x;
                  
                      var y;
                      if (p0.y !== p1.y)
                          y = p0.y + percent * (p1.y - p0.y);
                      else
                          y = p0.y;
                  
                      var p = {
                          x: x,
                          y: y
                      };
                      drawPoint('blue', p);
                  
                      return p;
                  }
                  
                  
                  pointAtPercent({ x: 50, y: 25 }, { x: 200, y: 300 }, 0.2)
                  pointAtPercent({ x: 150, y: 25 }, { x: 300, y: 100 }, 0.6)
                  pointAtPercent({ x: 650, y: 300 }, { x: 100, y: 400 }, 0.4)
                  


                  Fiddle - https://jsfiddle.net/goev47aL/

                  這篇關于沿兩點之間的直線獲取緯度和經度點,按百分比的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標記群集圖標顏色,繼承其余默認 CSS 屬性)
                  Trigger click on leaflet marker(觸發點擊傳單標記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)

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

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

                          <i id='y0bPT'><tr id='y0bPT'><dt id='y0bPT'><q id='y0bPT'><span id='y0bPT'><b id='y0bPT'><form id='y0bPT'><ins id='y0bPT'></ins><ul id='y0bPT'></ul><sub id='y0bPT'></sub></form><legend id='y0bPT'></legend><bdo id='y0bPT'><pre id='y0bPT'><center id='y0bPT'></center></pre></bdo></b><th id='y0bPT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='y0bPT'><tfoot id='y0bPT'></tfoot><dl id='y0bPT'><fieldset id='y0bPT'></fieldset></dl></div>
                              <tbody id='y0bPT'></tbody>
                            <tfoot id='y0bPT'></tfoot>
                            主站蜘蛛池模板: 欧美在线一区二区三区 | 久久中文视频 | 久久久涩 | 欧美视频xxx| 国产精品自产拍 | 精品成人av| 午夜国产在线 | 99福利在线观看 | 四虎最新视频 | 一区二区三区视频在线 | 久久亚洲一区二区 | 一区二区三区精品在线 | 久久天天躁狠狠躁夜夜躁2014 | 欧美午夜激情在线 | 日韩在线播放av | 91中文视频| 成人在线精品视频 | 国产成人综合网 | 天天操夜夜操 | 久久曰视频| 国产一区二区三区欧美 | 亚洲天堂av在线 | 精品国产18久久久久久二百 | 亚洲午夜精品一区二区三区他趣 | 无毛av | 欧美在线观看免费观看视频 | 精品久久伊人 | 欧美日韩国产一区二区三区 | 欧美久 | 一本一道久久a久久精品蜜桃 | 91久久国产综合久久 | 国产精品视频一区二区三区 | 欧美三级视频在线观看 | 日韩精品一区二区三区老鸭窝 | 精品日韩一区 | 色婷综合网 | 91色视频在线观看 | 亚洲高清中文字幕 | 日韩精品人成在线播放 | 亚洲精品一区二区二区 | 欧美精品一区二区在线观看 |