Skip to main content

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.

example 1 example2 example 3

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

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

  1. http://mathforum.org/library/drmath/view/51879.html
  2. http://www.edwilliams.org/avform.htm#Intermediate
  3. http://mathforum.org/library/drmath/view/55417.html
  4. http://mathforum.org/library/drmath/view/51822.html

License

MIT

Metadata

Release files for nautical-calculations 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nautical-calculations 1.0.1
File Size Uploaded
nautical_calculations-1.0.1.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nautical-calculations 1.0.1
File Interpreter ABI Platform
nautical_calculations-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / nautical_calculations-1.0.1.tar.gz

Download URL nautical_calculations-1.0.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9741526459ccd2c68c1061a82f4e3ce5e9d048e27bb5988088ef2b711c55a396
BLAKE2b-256 checksum
How to use checksums
e25977bbd62a62267004bdf52c6338a9351020aa01a384ee64ab444c69d9a25d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / nautical_calculations-1.0.1-py3-none-any.whl

Download URL nautical_calculations-1.0.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e33573ef1dbe62f36ab8e5c1ca86cd22c66e004eb04c6bda0f7aa04fba25a6ce
BLAKE2b-256 checksum
How to use checksums
67ed3f1cfddba40e2679e7e282eca71322453dc4007f7785670c3ec7c37890ea
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page