pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="mm00qs0" id='8BUJK'><tfoot id='8BUJK'></tfoot><dl id='8BUJK'><fieldset id='8BUJK'></fieldset></dl></div>
    • <bdo id='8BUJK'></bdo><ul id='8BUJK'></ul>

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

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

        <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="sqw2iyu" id='PkXD6'><tfoot id='PkXD6'></tfoot><dl id='PkXD6'><fieldset id='PkXD6'></fieldset></dl></div>
                  本文介紹了沿兩點之間的直線獲取緯度和經(jīng)度點,按百分比的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

                  圖片

                  問題

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

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

                  我現(xiàn)在有什么代碼

                  var 數(shù)據(jù) = [{坐標(biāo)":[53.409045,-2.985406]},{坐標(biāo)":[53.408747,-2.982862]},{坐標(biāo)":[53.407630,-2.984136]},{坐標(biāo)":[53.407142,-2.986931]}];var pointA = new L.LatLng(53.409045, -2.985406);變量點B;data.forEach(函數(shù)(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 與其相關(guān)點之間的多個坐標(biāo).

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

                  要測試的代碼

                  解決方案

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

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

                  var ctx = document.getElementById("myChart").getContext("2d");函數(shù)drawPoint(顏色,點){ctx.fillStyle = 顏色;ctx.beginPath();ctx.arc(point.x, point.y, 5, 0, 2 * Math.PI, false);ctx.fill();}函數(shù)畫線(點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('藍(lán)色', 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/

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

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

                  相關(guān)文檔推薦

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

                      <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="ymmuuyc" id='y0bPT'><tfoot id='y0bPT'></tfoot><dl id='y0bPT'><fieldset id='y0bPT'></fieldset></dl></div>
                              <tbody id='y0bPT'></tbody>
                            <tfoot id='y0bPT'></tfoot>
                            主站蜘蛛池模板: 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 垃圾处理设备_餐厨垃圾处理设备_厨余垃圾处理设备_果蔬垃圾处理设备-深圳市三盛环保科技有限公司 | 旋片真空泵_真空泵_水环真空泵_真空机组-深圳恒才机电设备有限公司 | 除湿机|工业除湿机|抽湿器|大型地下室车间仓库吊顶防爆除湿机|抽湿烘干房|新风除湿机|调温/降温除湿机|恒温恒湿机|加湿机-杭州川田电器有限公司 | 北京燃气公司 用户服务中心| 颚式破碎机,圆锥破碎机,制砂机-新乡市德诚机电制造有限公司 | 中高频感应加热设备|高频淬火设备|超音频感应加热电源|不锈钢管光亮退火机|真空管烤消设备 - 郑州蓝硕工业炉设备有限公司 | 水热合成反应釜-防爆高压消解罐-西安常仪仪器设备有限公司 | 不锈钢复合板|钛复合板|金属复合板|南钢集团安徽金元素复合材料有限公司-官网 | 东莞螺杆空压机_永磁变频空压机_节能空压机_空压机工厂批发_深圳螺杆空压机_广州螺杆空压机_东莞空压机_空压机批发_东莞空压机工厂批发_东莞市文颖设备科技有限公司 | ERP企业管理系统永久免费版_在线ERP系统_OA办公_云版软件官网 | 泵阀展|阀门展|水泵展|流体机械展 -2025上海国际泵管阀展览会flowtech china | 手术示教系统-数字化手术室系统-林之硕医疗云智能视频平台 | 合肥地磅_合肥数控切割机_安徽地磅厂家_合肥世佳电工设备有限公司 | 谷歌关键词优化-外贸网站优化-Google SEO小语种推广-思亿欧外贸快车 | 河南中专学校|职高|技校招生-河南中职中专网 | 胃口福饺子加盟官网_新鲜现包饺子云吞加盟 - 【胃口福唯一官网】 | 玻纤土工格栅_钢塑格栅_PP焊接_单双向塑料土工格栅_复合防裂布厂家_山东大庚工程材料科技有限公司 | RO反渗透设备_厂家_价格_河南郑州江宇环保科技有限公司 | 交联度测试仪-湿漏电流测试仪-双85恒温恒湿试验箱-常州市科迈实验仪器有限公司 | 桂林腻子粉_内墙外墙抗裂砂浆腻子粉推荐广西鑫达涂料厂家供应 | 光栅尺_Magnescale探规_磁栅尺_笔式位移传感器_苏州德美达 | 上海平衡机-单面卧式动平衡机-万向节动平衡机-圈带动平衡机厂家-上海申岢动平衡机制造有限公司 | 水轮机密封网 | 水轮机密封产品研发生产厂家 | 复盛空压机配件-空气压缩机-复盛空压机(华北)总代理 | 电杆荷载挠度测试仪-电杆荷载位移-管桩测试仪-北京绿野创能机电设备有限公司 | 臭氧实验装置_实验室臭氧发生器-北京同林臭氧装置网 | 时代北利离心机,实验室离心机,医用离心机,低速离心机DT5-2,美国SKC采样泵-上海京工实业有限公司 工业电炉,台车式电炉_厂家-淄博申华工业电炉有限公司 | 100国际学校招生 - 专业国际学校择校升学规划 | 精密五金加工厂-CNC数控车床加工_冲压件|蜗杆|螺杆加工「新锦泰」 | 湖南自考_湖南自学考试| TPE塑胶原料-PPA|杜邦pom工程塑料、PPSU|PCTG材料、PC/PBT价格-悦诚塑胶 | 帽子厂家_帽子工厂_帽子定做_义乌帽厂_帽厂_制帽厂_帽子厂_浙江高普制帽厂 | 蜂窝块状沸石分子筛-吸附脱硫分子筛-萍乡市捷龙环保科技有限公司 | 纸箱抗压机,拉力机,脂肪测定仪,定氮仪-山东德瑞克仪器有限公司 | 选矿设备,选矿生产线,选矿工艺,选矿技术-昆明昆重矿山机械 | ICP备案查询_APP备案查询_小程序备案查询 - 备案巴巴 | 德州万泰装饰 - 万泰装饰装修设计软装家居馆 | 建筑消防设施检测系统检测箱-电梯**检测仪器箱-北京宇成伟业科技有限责任公司 | 招商帮-一站式网络营销服务|搜索营销推广|信息流推广|短视视频营销推广|互联网整合营销|网络推广代运营|招商帮企业招商好帮手 | 寮步纸箱厂_东莞纸箱厂 _东莞纸箱加工厂-东莞市寮步恒辉纸制品厂 |