Giter Club home page Giter Club logo

nautical_calculations's Introduction

nautical_calculations

nautical-calculations is a Python library to be used for performing 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 process 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

Sample code link

https://github.com/AmeyHengle/nautical_calculations/blob/master/samples/sample_code.py

PyPI package link

https://pypi.org/project/nautical-calculations/

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

nautical_calculations's People

Contributors

ameyhengle avatar ameyh98 avatar

Stargazers

Jorge Mancinelli avatar  avatar Jose Cordero avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.