Skip to main content

A package that can calculate distance between two points on Earth

Project description

Distance Calculator

Local time difference calculations.

  1. The meridian difference between the two determined points is revealed.

    • If the meridians are located in the same hemisphere, they should be subtracted, if they are located in different hemispheres, they should be added.
  2. The resulting meridian difference is multiplied by 4 minutes.

    • Additional information:

      • Because the Earth rotates from west to east, local time is always ahead in the east and behind in the west.

      • Local times of regions on the same meridian are always the same.

# local_time_calculation(longitude1: int, longitude2: int)

print(local_time_calculation(3, 7))

# 16

Anti-meridian Calculation

To find the anti-meridian of a meridian, it is necessary to subtract it from 180.

# find_anti_meridian(longitude: int)

print(find_anti_meridian(34))

# 146

Calculating the distance between meridians

To understand how many kilometers are between two meridians at our current point;

First, we must calculate the length of the parallel at that point, using the angle of the parallel at that point.

Then we have to divide by 360 since there are 360 meridians in the world.

# distance_between_meridians(latitude: int)

distance_between_meridians(10)

Calculating the distance between two points on Earth

Calculate the distance between two points on Earth with Haversine formula.

# distance_calculation(latitude: float, longitude: float, target_latitude: float, target_longitude: float, miles=False)

distance_calculation(13, 24, 42, 12)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dist_calculating-0.0.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

dist_calculating-0.0.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page