Get all the nautical calculations here.
Project description
nautical_calculations
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.
Installation
Use the package manager pip to install nautical_calculations.
pip install nautical-calculations
Usage
from nautical_calculations import *
or
from nautical_calculations.basic import get_distance
from nautical_calculations.basic import get_bearing
from nautical_calculations.basic import rhumb_line
from nautical_calculations.operations import get_point
from nautical_calculations.operations import get_midpoint
from nautical_calculations.operations import divide_by_interval
from nautical_calculations.operations import divide_by_number
Usage examples:
I) Nautical distance (km)
get_distance(lat1,long1,lat2,long2) # returns the nautical distance (in km) between two coordinates (lat1,long1) and (lat2,long2)
II) Bearing (degrees)
get_bearing(lat1,long1,lat2,long2) # returns the bearing between two coordinates (lat1,long1) and (lat2,long2)
III) Rhumb Line (km)
rhumb_line(lat1, long1, lat2, long2) # returns rhumb line distance (in km) between two given coordinates
IV) Point (lat,long)
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) Intermediate points (by number)
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) Intermediate points (by interval)
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) Midpoint
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) Conversions
from nautical_calculations.operations import convert_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 repository link
https://github.com/AmeyHengle/nautical_calculations.git
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
References
- 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
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nautical_calculations-1.0.1.tar.gz
.
File metadata
- Download URL: nautical_calculations-1.0.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9741526459ccd2c68c1061a82f4e3ce5e9d048e27bb5988088ef2b711c55a396 |
|
MD5 | fde52d6977ebdcc2b3d5f493ae7098c8 |
|
BLAKE2b-256 | e25977bbd62a62267004bdf52c6338a9351020aa01a384ee64ab444c69d9a25d |
File details
Details for the file nautical_calculations-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: nautical_calculations-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e33573ef1dbe62f36ab8e5c1ca86cd22c66e004eb04c6bda0f7aa04fba25a6ce |
|
MD5 | 91246c9aad36782e9f8676d2189a6c0b |
|
BLAKE2b-256 | 67ed3f1cfddba40e2679e7e282eca71322453dc4007f7785670c3ec7c37890ea |