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

<legend id='H00t5'><style id='H00t5'><dir id='H00t5'><q id='H00t5'></q></dir></style></legend>
    <tfoot id='H00t5'></tfoot>

    1. <small id='H00t5'></small><noframes id='H00t5'>

      • <bdo id='H00t5'></bdo><ul id='H00t5'></ul>

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

        javascript緯度經(jīng)度到地球上的xyz位置(threejs)

        javascript Latitude Longitude to xyz position on earth (threejs)(javascript緯度經(jīng)度到地球上的xyz位置(threejs))

            <bdo id='nBD5V'></bdo><ul id='nBD5V'></ul>

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

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

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

                <tfoot id='nBD5V'></tfoot>
                  本文介紹了javascript緯度經(jīng)度到地球上的xyz位置(threejs)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在玩three.js

                  i′m playing arround with three.js

                  我想在更大的球體上渲染特定地理坐標(biāo)上的對象,我非常接近解決方案,但我沒有從 lat lon 獲得正確的 xyz 位置

                  i want to render objects on specific geocoordinates on a bigger sphere, i′m pretty near to the solution, but i dont get the correct xyz position from lat lon

                  我在jsfiddle上設(shè)置了一個測試用例,有兩個坐標(biāo)

                  i have set up a test case on jsfiddle, there are two coordinates

                  latlons = [[40.7142700,-74.0059700], [52.5243700,13.4105300]];
                  

                  紐約和柏林

                  這是我從緯度和半徑計算 xyz 的函數(shù)

                  and this is my function to calc xyz from lat lon and radius

                  function calcPosFromLatLonRad(lat,lon,radius){
                  
                  // Attempt1
                  var cosLat = Math.cos(lat * Math.PI / 180.0);
                  var sinLat = Math.sin(lat * Math.PI / 180.0);
                  var cosLon = Math.cos(lon * Math.PI / 180.0);
                  var sinLon = Math.sin(lon * Math.PI / 180.0);
                  var rad = radius;
                  y = rad * cosLat * sinLon;
                  x = rad * cosLat * cosLon;
                  z = rad * sinLat;
                  
                  // Attempt2
                  // x = radius *  Math.sin(lat) * Math.cos(lon)
                  // y = radius *  Math.sin(lat) * Math.sin(lon)
                  // z = radius * Math.cos(lat)
                  
                  
                  // Attempt3
                  // latitude = lat * Math.PI/180
                  // longitude = lon * Math.PI/180
                  // x =  -radius * Math.cos(latitude) * Math.cos(longitude)
                  // y =  radius * Math.sin(latitude) 
                  // z =  radius * Math.cos(latitude) * Math.sin(longitude)
                  
                  
                  // Attempt4
                  // var phi   = (90-lat)*(Math.PI/180);
                  // var theta = (lng+180)*(Math.PI/180);
                  // x = ((rad) * Math.sin(phi)*Math.cos(theta));
                  // z = ((rad) * Math.sin(phi)*Math.sin(theta));
                  // y = ((rad) * Math.cos(phi));
                  
                  
                  
                     console.log([x,y,z]);
                     return [x,y,z];
                  }
                  

                  但所有嘗試都返回不同的 xy,它們都不正確(z 始終正確).

                  but all attempts return different xy, and they are all not correct ( z is always correct).

                  有人可以指導(dǎo)我正確的方式嗎?我不知道可能出了什么問題

                  could someone pleas guide me to the right way ? i have no idea what could be wrong

                  這就是要玩的小提琴

                  更新:正在工作的 jsfiddle

                  推薦答案

                  不幸的是,我無法進(jìn)一步解釋,但在玩了這個之后,它就像一個魅力:)

                  unfortunatly i can′t further explain, but after playing around this one works like a charme :)

                  function calcPosFromLatLonRad(lat,lon,radius){
                    
                      var phi   = (90-lat)*(Math.PI/180);
                      var theta = (lon+180)*(Math.PI/180);
                  
                      x = -(radius * Math.sin(phi)*Math.cos(theta));
                      z = (radius * Math.sin(phi)*Math.sin(theta));
                      y = (radius * Math.cos(phi));
                    
                      return [x,y,z];
                  
                  }
                  

                  是的,那很酷,不是嗎?而且我仍然對一些更短的方程式感興趣

                  yeah thats pretty cool isnt it ? And i′m still interested into some shorter equation

                  工作小提琴

                  這篇關(guān)于javascript緯度經(jīng)度到地球上的xyz位置(threejs)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數(shù)據(jù)更新 Observable)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創(chuàng)建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態(tài)元素 - Angular 2 amp;離子2)
                    <tbody id='WuOZd'></tbody>

                    <bdo id='WuOZd'></bdo><ul id='WuOZd'></ul>

                    1. <legend id='WuOZd'><style id='WuOZd'><dir id='WuOZd'><q id='WuOZd'></q></dir></style></legend>
                      • <small id='WuOZd'></small><noframes id='WuOZd'>

                            <tfoot id='WuOZd'></tfoot>
                            <i id='WuOZd'><tr id='WuOZd'><dt id='WuOZd'><q id='WuOZd'><span id='WuOZd'><b id='WuOZd'><form id='WuOZd'><ins id='WuOZd'></ins><ul id='WuOZd'></ul><sub id='WuOZd'></sub></form><legend id='WuOZd'></legend><bdo id='WuOZd'><pre id='WuOZd'><center id='WuOZd'></center></pre></bdo></b><th id='WuOZd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WuOZd'><tfoot id='WuOZd'></tfoot><dl id='WuOZd'><fieldset id='WuOZd'></fieldset></dl></div>
                            主站蜘蛛池模板: 亚洲精品免费视频 | 国产乱码精品一区二区三区五月婷 | 香蕉视频1024 | 国产伦精品一区二区三区照片91 | 日韩视频国产 | 国产一区二区电影网 | 日韩在线观看网站 | 高清久久久 | 久久久久一区二区三区 | 日韩免费一区二区 | h片在线观看免费 | 久久久成人精品 | 欧美专区在线 | 五月激情婷婷网 | 福利视频一区二区三区 | 成人av在线大片 | 91porn成人精品 | 综合网在线 | 手机av在线 | 黄色网毛片 | 日韩av.com | 日本欧美大片 | 久久精品福利视频 | 久久99精品久久久久久 | 日韩精品1区2区 | 欧美久久综合 | av一区二区三区 | 欧美午夜一区 | 成人在线视频免费看 | 免费看大片bbbb欧美 | 亚洲视频在线看 | 男女污污网站 | 国产农村一级国产农村 | 欧美aⅴ在线观看 | 亚洲丝袜天堂 | 手机在线观看 | 男女视频91 | 国产免费va| av日韩精品 | 国产精品国产精品国产专区不卡 | 国产精品一区二区三区久久久 |