- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
在 ruby/rails 中是否有一种简单的、非数学类的和确定的方法来执行此操作,其中输入是:
1) An Initial Geo-Coordinate
2) A Bearing
3) A Distance in the Bearing's Direction
输出是一个新的地理坐标
我看过 Ruby Geocoder Gem ,但它不会这样做。
谢谢!
最佳答案
在 Google 中首次搜索“距离方位”:Calculate distance, bearing and more between Latitude/Longitude points
JavaScript 代码在 Ruby 中运行良好:
lat1 = 0.9250245 # starting point's latitude (in radians)
lon1 = 0.0174532 # starting point's longitude (in radians)
brng = 1.67551 # bearing (in radians)
d = 124.8 # distance to travel in km
R = 6371.0 # earth's radius in km
lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) +
Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) )
# => 0.9227260710962849
lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),
Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2))
# => 0.0497295729068199
# NB. Ensure that all values are cast to floats
关于ruby - Rails/ruby 从起点使用给定距离和方位计算新坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12094484/
是否有机会为标记设置旋转?现在,我将 map 方位设置为一个标记的 Angular ,但其他标记应该有自己的标记方位。 目前,我正在使用这样的标记定义: var marker_el = documen
我正在尝试根据起点纬度/经度、方位角和距离找到目的地点。下面这个网站的计算器给出了我想要的结果。 http://www.movable-type.co.uk/scripts/latlong.html
大家好,我需要在我的 iPhone 应用程序中查找高度、方位和 GPS 精度。我已经在我的 Android 应用程序上完成了此操作。在android中,我是这样做的: public void onLo
第一次张贴在这里。 我正在对为桥梁检查 ROV 八旋翼飞行器收集的 GPS 数据进行一些数据分析。我们的八旋翼机在 ROS 上运行使用 3D 扫描激光雷达、立体视觉、INS 和其他一些巧妙的技术。我目
我试图通过仅以度数和距离(相对于另一个已放置的标记)指定其航向来放置标记 Google Maps API V.3。 无法在 SO 上找到任何类似的东西,在此先感谢。 最佳答案 最简单的方法是编写一个函
我是一名优秀的程序员,十分优秀!