把所有的航海计算都记在这里。
nautical-calculations的Python项目详细描述
航海计算
nautical-calculations is a Python library used for dealing with some basic Geospatial calculations on the geographic coordinate system.
It is developed to act as an interface for performing calculations like the nautical distance (Great Circle distance), Rhumb line distance and bearing angle. It explores the possiblitity of using these basic terms in performing operations like:
- Finding all the coordinates which lie on the great circle line joining any two points on the map
- Finding the coordinates of a point at a particular angle and distance from the given point.
- Finding the coordinates of midpoint on the great circle line joining any two points on the map.
The main idea is to save the time of defining your own functions to derive these terms, thus making the project development easier.
安装
使用包管理器pip安装航海计算。在
pip install nautical-calculations
使用
^{pr2}$或者
fromnautical_calculations.basicimportget_distancefromnautical_calculations.basicimportget_bearingfromnautical_calculations.basicimportrhumb_linefromnautical_calculations.operationsimportget_pointfromnautical_calculations.operationsimportget_midpointfromnautical_calculations.operationsimportdivide_by_intervalfromnautical_calculations.operationsimportdivide_by_number
使用示例:
I)航程(km)
get_distance(lat1,long1,lat2,long2)# returns the nautical distance (in km) between two coordinates (lat1,long1) and (lat2,long2)
II)方位(度)
get_bearing(lat1,long1,lat2,long2)# returns the bearing between two coordinates (lat1,long1) and (lat2,long2)
III)恒线(km)
rhumb_line(lat1,long1,lat2,long2)# returns rhumb line distance (in km) between two given coordinates
IV)点(纬度、经度)
get_point(lat,long,azimuth,distance)# returns the coordinate (lat1,long1) at a particular distance and angle (azimuth) from the given point (lat,long)
V)中间点(按数量)
divide_by_number(lat1,long1,lat2,long2,number)# returns a list containing all points in between the two specified coordinate pairs (lat-long) given the number value
VI)中间点(按间隔)
divide_by_interval(lat1,long1,lat2,long2,interval)# returns a list containing all points in between the two specified coordinate pairs (lat-long) given the interval value
VII)中点
get_midpoint(lat1,long1,lat2,long2)#Returns the coordinates of midpoint on the rhumb line joining the given endpoint coordinates (lat1,long1,lat2,long2)
VIII)转换
fromnautical_calculations.operationsimportconvert_to_radians,convert_to_miles,convert_to_kilometres,convert_to_degress
convert_to_miles(distance)#converts distance in kms to miles
convert_to_kilometres(distance)#converts distance in miles to kms
convert_to_radians(angle)#converts angle in degrees to radians
convert_to_degress(angle)#converts angle in radians to degrees
Github存储库链接
https://github.com/AmeyHengle/nautical_calculations.git
贡献
欢迎拉取请求。对于重大变化,请先打开一个问题,讨论您希望更改的内容。在
请确保根据需要更新测试。在
参考文献
- http://mathforum.org/library/drmath/view/51879.html
- http://www.edwilliams.org/avform.htm#Intermediate
- http://mathforum.org/library/drmath/view/55417.html
- http://mathforum.org/library/drmath/view/51822.html
许可证
- 项目
标签: