geocalc


Namegeocalc JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryA library for geometric calculations
upload_time2023-04-26 15:16:24
maintainer
docs_urlNone
authorCharles Gameti
requires_python>=3.7
licenseMIT License Copyright (c) 2023 Charles Gameti Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python geomatic levelling curves geodesy polygon triangle horizontal vertical
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GeoCalc

GeoCalc is a Python library for geometric calculations, focusing on horizontal and vertical curves, angles, triangles, polygons, leveling, and geodesy in transportation engineering and surveying. The library provides various classes and functions for computing and setting out curves, angles, and more.

## Features

- Compute various curve parameters for horizontal curves (Simple, Circular, and Spiral) and Vertical Curves. Calculate the Point of Intersection (PI), Point of Curvature (PC), and Point of Tangency (PT). Calculate chainages and convert between meters and chainage strings. Support for both metric and imperial units
- Angle computations and conversions, including degree-minute-second (DMS) and decimal degrees
- Triangle calculations including area, perimeter, and angles
- Polygon calculations including area and perimeter
- Levelling calculations for elevation and height differences
- Geodesy calculations for distance and bearing

## Installation

You can install GeoCalc using pip:

```bash
pip install geocalc
```

## Usage

# Horizontal Curves

```python
from geocalc import HorizontalCurve, CircularCurves, SpiralCurves

# Create a circular curve

curve = CircularCurve(radius=400, central_angle=24.533333)
starting_chainage = 4545.500
interval = 20
print(curve)

print("External:", curve.external_distance())
print("Middle Ordinate:", curve.middle_ordinate())
print("Long Chord:", curve.long_chord())
```

## Computing Stake Curve by Coordinates

```python
initial_x, initial_y, azimuth = 5723.183, 3728.947, 326.672222

pi,pc,pt, stake_curve_by_coordinates_table = curve.stake_curve_by_coordinates( interval=interval, initial_x=initial_x, initial_y=initial_y, azimuth=azimuth, PI=starting_chainage)

print(pi,pc,pt)
print("\nComputing Stake Curve by Coordinates:\n", stake_curve_by_coordinates_table)
```

## Create a spiral curve

```python
spiral_curve = SpiralCurves(radius=100, degree_of_curve=2)

# Calculate curve parameters

spiral_degree_of_curve = spiral_curve.spiral_degree_of_curve(Ls=20)
```

# Vertical Curves

```python
from geocalc import VerticalCurve

# Create a vertical curve

vertical_curve = VerticalCurve(PVI_elevation=100, grade_in=2, grade_out=-3, length=200)

# Calculate curve parameters

elevation_at_station = vertical_curve.elevation_at_station(50)
```

# Angles

```python
# Example usage

from geocalc import Angle

angle_deg = Angle(45, 'deg')
print("DMS:", angle_deg.dms)
print("Degrees:", angle_deg.deg)
print("Radians:", angle_deg.rad)
print("Grads:", angle_deg.grad)

# An example with DMS data
angle_dms = Angle((30, 45, 0), 'dms')
print("DMS:", angle_dms.dms)
print("Degrees:", angle_dms.deg)
print("Radians:", angle_dms.rad)
print("Grads:", angle_dms.grad)
```

## Example more usage

```python
angle_converter = Angle()

# Degrees to radians
print("Degrees to radians:", angle_converter.degrees_to_radians(45))

# Radians to degrees
print("Radians to degrees:", angle_converter.radians_to_degrees(math.pi/4))

# Degrees to grads
print("Degrees to grads:", angle_converter.degrees_to_grads(45))

# Grads to degrees
print("Grads to degrees:", angle_converter.grads_to_degrees(50))

# Radians to grads
print("Radians to grads:", angle_converter.radians_to_grads(math.pi/4))

# Grads to radians
print("Grads to radians:", angle_converter.grads_to_radians(50))

# Degrees to DMS
print("Degrees to DMS:", angle_converter.degrees_to_dms(45.12345))

# DMS to degrees
print("DMS to degrees:", angle_converter.dms_to_degrees(45, 7, 24.42))
```

# Triangle

## Example usage

```python
from geocalc import Triangle

triangle = Triangle(a=3, b=4, c=5, A=(0, 0), B=(3, 0))
vertex_c1, vertex_c2 = triangle.calculate_other_coordinates()

print("Possible third vertex coordinates:", vertex_c1, vertex_c2)
```

## Example usage

```python
triangle_area = Triangle()

# Heron's formula
print("Heron's formula:", triangle_area.heron_formula(3, 4, 5))

# Trigonometric formula
print("Trigonometric formula:", triangle_area.trigonometric_formula(3, 4, 90))

# Base-height formula
print("Base-height formula:", triangle_area.base_height_formula(3, 4))

# Coordinates formula
print("Coordinates formula:", triangle_area.coordinates_formula(coords=((0, 0), (3, 0), (0, 4))))
```

## Example usage

```python
triangle = Triangle(3, 4, 5, angle_c=90)

# Heron's formula
print("Heron's formula:", triangle.heron())

# Trigonometric formula
print("Trigonometric formula:", triangle.trigonometric())
```

# Polygon

```python
from geocalc import Polygon

#Create a polygon with coordinates
vertices = [(1613.26, 2418.11), (1806.71, 2523.16), (1942.17, 2366.84), (1901.89, 2203.18), (1652.08, 2259.26)]

polygon = Polygon(vertices)
print("Shoelace formula: ", polygon.shoelace())
print("Triangulation: ", polygon.triangulation())
print("Trapezoidal rule: ", polygon.trapezoidal())
print("Monte Carlo method (10,000 points): ", polygon.monte_carlo(num_points=10000))
print("Green's theorem: ", polygon.greens_theorem())
print("\nCentroid: ", polygon.centroid())
print("Moment of inertia: ", polygon.moment_of_inertia())


print("\nAngle Between Side 1 and 2: ", polygon.angle_between_sides(0,1))
print("Length of side 1: ", polygon.side_length_irregular(0))
print("Length of side 2: ", polygon.side_length_irregular(1))

print("\nIs Point(1806.71, 2523.16) inside: ", polygon.is_point_inside_polygon((1806.71, 2400.16)))
print("Is convex: ", polygon.is_convex())
print("\nBounding box: ", polygon.bounding_box())
print("\nOriginal: ", polygon.vertices)

polygon.scale(2.5)
print("\nScaled by 2.5: ", polygon.vertices)

polygon.scale(1/2.5)
print("\nUnScale by 1/2.5: ", polygon.vertices)

polygon.translate(1.0, 1.0)
print("\nTranslated by (1.0, 1.0): ",polygon.vertices )
print("\nNearest point to polygon: ",polygon.nearest_point_on_polygon((1920.17 ,2200.18) ))

print("\nConvexHull: ",polygon.convex_hull())
```

## Create a new regular polygon

```python
polygon = Polygon(num_sides=5, side_length=4)
print("\n\nArea: ", polygon.area_polygon())
print("Perimeter: ", polygon.perimeter())
print("Interior angle: ", polygon.interior_angle())
print("Exterior angle: ", polygon.exterior_angle())

perimeter = polygon.perimeter()
area = polygon.area_polygon()
circumradius = polygon.circumradius()
inradius = polygon.inradius()

# Create polygon and compute the length from other parameters
polygon = Polygon(num_sides=5)

print("Side length from perimeter:", polygon.get_side_length(perimeter=perimeter))
print("Side length from area:", polygon.get_side_length(area=area))
print("Side length from circumradius:", polygon.get_side_length(circumradius=circumradius))
print("Side length from inradius:", polygon.get_side_length(inradius=inradius))
```

# Levelling

```python
from geocalc import Levelling

starting_tbm = 100.000
closing_tbm = 98.050
data =  [
    ('A', 1.751, None, None),  
    ('B', None, 0.540, None),
    ('C', 0.300, None, 2.100),
    ('D', None, 1.100, None),
    ('E', None, 1.260, None),
    ('F', 1.500, None, 2.300),
    ('G', None, None, 1.100)
]

leveling = Levelling(starting_tbm=starting_tbm, closing_tbm=closing_tbm, k=5)

# Add data
for station, bs, is_, fs in data:
    leveling.add_data(station, bs, is_, fs)

# Calculate reduced levels using HPC algorithm
leveling.compute_heights(method="hpc")
print(f"\n\nNumber of instrument station = {leveling.numberSTN}\n")

# Perform arithmetic checks
arithmetic_results = leveling.arithmetic_check()

print("\nArithmetic Checks:")
print(f"Sum of BS = {arithmetic_results['sum_bs']:.3f}")
print(f"Sum of FS = {arithmetic_results['sum_fs']:.3f}")
print(f"First RL = {arithmetic_results['first_rl']:.3f}")
print(f"Last RL = {arithmetic_results['last_rl']:.3f}")
print(f"Sum of BS - Sum of FS = {arithmetic_results['bs_minus_fs']:.4f}")
print(f"Last RL - First RL = {arithmetic_results['last_rl_minus_first_rl']:.4f}")

if arithmetic_results['is_arithmetic_check_passed']:
    print("Arithmetic Checks are OK.")
else:
    diff = arithmetic_results['bs_minus_fs'] - arithmetic_results['last_rl_minus_first_rl']
    print(f"Arithmetic Checks failed with {diff:.4f} differences")

print(f"\nAllowable misclose = {leveling.allowable_misclose():.4f} mm")
print(f"Misclose = {leveling.misclose:.4f} m ({leveling.misclose * 1000:.4f} mm)" if leveling.misclose is not None else None)
print(f"Leveling Status: {'Work is accepted' if leveling.is_work_accepted() else 'Work is not accepted'}.\n")

print(f"Correction = {round(leveling.correction,5) if leveling.correction is not None else None}")
print(f"Correction per station = {round(leveling.adjustment_per_station,5) if leveling.adjustment_per_station is not None else None}\n")

#Print HPC table
print("HPC:",leveling.get_dataFrame())

```

## Calculate reduced levels using Rise & Fall algorithm

```python
leveling.compute_heights(method="rise_fall")
print(leveling.misclose)        # Print the misclose
print(leveling.adjustedRLs)     # Prints the adjusted RLs

#Include the rounding decimal points
print("Rise & Fall:\n",leveling.get_dataFrame(roundDigits=5))

```

# Geodesy

```python
from geocalc import Geodesy

# Calculate distance and bearing between two points
point_a = (12.4924, 41.8902)  # Colosseum, Rome
point_b = (2.2945, 48.8582)   # Eiffel Tower, Paris

distance, bearing = Geodesy.distance_and_bearing(point_a, point_b)
```

```python
geodesy = Geodesy()

# Haversine distance
distance1 = geodesy.haversine_distance(40.689247, -74.044502, 48.858844, 2.294351)
print(f"Haversine distance: {distance1} meters")

# Vincenty distance
distance2 = geodesy.vincenty_distance(40.689247, -74.044502, 48.858844, 2.294351)
print(f"Vincenty distance: {distance2} meters")

# Area of geodesic polygon
polygon_coordinates = [(30, 0), (30, 10), (40, 10), (40, 0)]
area = geodesy.area_of_geodesic_polygon(polygon_coordinates)
print(f"Area of geodesic polygon: {area} square meters")
```

## Contributing

If you'd like to contribute to GeoCalc, please open an issue or submit a pull request on the GitHub repository.

## License

This project is licensed under the MIT License. See the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "geocalc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Charles Gameti <gameticharles@gmail.com>, \"Fiifi O. Turkson\" <fiiturkson@gmail.com>",
    "keywords": "python,geomatic,levelling,curves,geodesy,polygon,triangle,horizontal,vertical",
    "author": "Charles Gameti",
    "author_email": "Charles Gameti <gameticharles@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/12/89/66276b30feddd31f25a180d4997b70bf986f04469cdec14702eed52a5518/geocalc-0.0.2.tar.gz",
    "platform": null,
    "description": "# GeoCalc\n\nGeoCalc is a Python library for geometric calculations, focusing on horizontal and vertical curves, angles, triangles, polygons, leveling, and geodesy in transportation engineering and surveying. The library provides various classes and functions for computing and setting out curves, angles, and more.\n\n## Features\n\n- Compute various curve parameters for horizontal curves (Simple, Circular, and Spiral) and Vertical Curves. Calculate the Point of Intersection (PI), Point of Curvature (PC), and Point of Tangency (PT). Calculate chainages and convert between meters and chainage strings. Support for both metric and imperial units\n- Angle computations and conversions, including degree-minute-second (DMS) and decimal degrees\n- Triangle calculations including area, perimeter, and angles\n- Polygon calculations including area and perimeter\n- Levelling calculations for elevation and height differences\n- Geodesy calculations for distance and bearing\n\n## Installation\n\nYou can install GeoCalc using pip:\n\n```bash\npip install geocalc\n```\n\n## Usage\n\n# Horizontal Curves\n\n```python\nfrom geocalc import HorizontalCurve, CircularCurves, SpiralCurves\n\n# Create a circular curve\n\ncurve = CircularCurve(radius=400, central_angle=24.533333)\nstarting_chainage = 4545.500\ninterval = 20\nprint(curve)\n\nprint(\"External:\", curve.external_distance())\nprint(\"Middle Ordinate:\", curve.middle_ordinate())\nprint(\"Long Chord:\", curve.long_chord())\n```\n\n## Computing Stake Curve by Coordinates\n\n```python\ninitial_x, initial_y, azimuth = 5723.183, 3728.947, 326.672222\n\npi,pc,pt, stake_curve_by_coordinates_table = curve.stake_curve_by_coordinates( interval=interval, initial_x=initial_x, initial_y=initial_y, azimuth=azimuth, PI=starting_chainage)\n\nprint(pi,pc,pt)\nprint(\"\\nComputing Stake Curve by Coordinates:\\n\", stake_curve_by_coordinates_table)\n```\n\n## Create a spiral curve\n\n```python\nspiral_curve = SpiralCurves(radius=100, degree_of_curve=2)\n\n# Calculate curve parameters\n\nspiral_degree_of_curve = spiral_curve.spiral_degree_of_curve(Ls=20)\n```\n\n# Vertical Curves\n\n```python\nfrom geocalc import VerticalCurve\n\n# Create a vertical curve\n\nvertical_curve = VerticalCurve(PVI_elevation=100, grade_in=2, grade_out=-3, length=200)\n\n# Calculate curve parameters\n\nelevation_at_station = vertical_curve.elevation_at_station(50)\n```\n\n# Angles\n\n```python\n# Example usage\n\nfrom geocalc import Angle\n\nangle_deg = Angle(45, 'deg')\nprint(\"DMS:\", angle_deg.dms)\nprint(\"Degrees:\", angle_deg.deg)\nprint(\"Radians:\", angle_deg.rad)\nprint(\"Grads:\", angle_deg.grad)\n\n# An example with DMS data\nangle_dms = Angle((30, 45, 0), 'dms')\nprint(\"DMS:\", angle_dms.dms)\nprint(\"Degrees:\", angle_dms.deg)\nprint(\"Radians:\", angle_dms.rad)\nprint(\"Grads:\", angle_dms.grad)\n```\n\n## Example more usage\n\n```python\nangle_converter = Angle()\n\n# Degrees to radians\nprint(\"Degrees to radians:\", angle_converter.degrees_to_radians(45))\n\n# Radians to degrees\nprint(\"Radians to degrees:\", angle_converter.radians_to_degrees(math.pi/4))\n\n# Degrees to grads\nprint(\"Degrees to grads:\", angle_converter.degrees_to_grads(45))\n\n# Grads to degrees\nprint(\"Grads to degrees:\", angle_converter.grads_to_degrees(50))\n\n# Radians to grads\nprint(\"Radians to grads:\", angle_converter.radians_to_grads(math.pi/4))\n\n# Grads to radians\nprint(\"Grads to radians:\", angle_converter.grads_to_radians(50))\n\n# Degrees to DMS\nprint(\"Degrees to DMS:\", angle_converter.degrees_to_dms(45.12345))\n\n# DMS to degrees\nprint(\"DMS to degrees:\", angle_converter.dms_to_degrees(45, 7, 24.42))\n```\n\n# Triangle\n\n## Example usage\n\n```python\nfrom geocalc import Triangle\n\ntriangle = Triangle(a=3, b=4, c=5, A=(0, 0), B=(3, 0))\nvertex_c1, vertex_c2 = triangle.calculate_other_coordinates()\n\nprint(\"Possible third vertex coordinates:\", vertex_c1, vertex_c2)\n```\n\n## Example usage\n\n```python\ntriangle_area = Triangle()\n\n# Heron's formula\nprint(\"Heron's formula:\", triangle_area.heron_formula(3, 4, 5))\n\n# Trigonometric formula\nprint(\"Trigonometric formula:\", triangle_area.trigonometric_formula(3, 4, 90))\n\n# Base-height formula\nprint(\"Base-height formula:\", triangle_area.base_height_formula(3, 4))\n\n# Coordinates formula\nprint(\"Coordinates formula:\", triangle_area.coordinates_formula(coords=((0, 0), (3, 0), (0, 4))))\n```\n\n## Example usage\n\n```python\ntriangle = Triangle(3, 4, 5, angle_c=90)\n\n# Heron's formula\nprint(\"Heron's formula:\", triangle.heron())\n\n# Trigonometric formula\nprint(\"Trigonometric formula:\", triangle.trigonometric())\n```\n\n# Polygon\n\n```python\nfrom geocalc import Polygon\n\n#Create a polygon with coordinates\nvertices = [(1613.26, 2418.11), (1806.71, 2523.16), (1942.17, 2366.84), (1901.89, 2203.18), (1652.08, 2259.26)]\n\npolygon = Polygon(vertices)\nprint(\"Shoelace formula: \", polygon.shoelace())\nprint(\"Triangulation: \", polygon.triangulation())\nprint(\"Trapezoidal rule: \", polygon.trapezoidal())\nprint(\"Monte Carlo method (10,000 points): \", polygon.monte_carlo(num_points=10000))\nprint(\"Green's theorem: \", polygon.greens_theorem())\nprint(\"\\nCentroid: \", polygon.centroid())\nprint(\"Moment of inertia: \", polygon.moment_of_inertia())\n\n\nprint(\"\\nAngle Between Side 1 and 2: \", polygon.angle_between_sides(0,1))\nprint(\"Length of side 1: \", polygon.side_length_irregular(0))\nprint(\"Length of side 2: \", polygon.side_length_irregular(1))\n\nprint(\"\\nIs Point(1806.71, 2523.16) inside: \", polygon.is_point_inside_polygon((1806.71, 2400.16)))\nprint(\"Is convex: \", polygon.is_convex())\nprint(\"\\nBounding box: \", polygon.bounding_box())\nprint(\"\\nOriginal: \", polygon.vertices)\n\npolygon.scale(2.5)\nprint(\"\\nScaled by 2.5: \", polygon.vertices)\n\npolygon.scale(1/2.5)\nprint(\"\\nUnScale by 1/2.5: \", polygon.vertices)\n\npolygon.translate(1.0, 1.0)\nprint(\"\\nTranslated by (1.0, 1.0): \",polygon.vertices )\nprint(\"\\nNearest point to polygon: \",polygon.nearest_point_on_polygon((1920.17 ,2200.18) ))\n\nprint(\"\\nConvexHull: \",polygon.convex_hull())\n```\n\n## Create a new regular polygon\n\n```python\npolygon = Polygon(num_sides=5, side_length=4)\nprint(\"\\n\\nArea: \", polygon.area_polygon())\nprint(\"Perimeter: \", polygon.perimeter())\nprint(\"Interior angle: \", polygon.interior_angle())\nprint(\"Exterior angle: \", polygon.exterior_angle())\n\nperimeter = polygon.perimeter()\narea = polygon.area_polygon()\ncircumradius = polygon.circumradius()\ninradius = polygon.inradius()\n\n# Create polygon and compute the length from other parameters\npolygon = Polygon(num_sides=5)\n\nprint(\"Side length from perimeter:\", polygon.get_side_length(perimeter=perimeter))\nprint(\"Side length from area:\", polygon.get_side_length(area=area))\nprint(\"Side length from circumradius:\", polygon.get_side_length(circumradius=circumradius))\nprint(\"Side length from inradius:\", polygon.get_side_length(inradius=inradius))\n```\n\n# Levelling\n\n```python\nfrom geocalc import Levelling\n\nstarting_tbm = 100.000\nclosing_tbm = 98.050\ndata =  [\n    ('A', 1.751, None, None),  \n    ('B', None, 0.540, None),\n    ('C', 0.300, None, 2.100),\n    ('D', None, 1.100, None),\n    ('E', None, 1.260, None),\n    ('F', 1.500, None, 2.300),\n    ('G', None, None, 1.100)\n]\n\nleveling = Levelling(starting_tbm=starting_tbm, closing_tbm=closing_tbm, k=5)\n\n# Add data\nfor station, bs, is_, fs in data:\n    leveling.add_data(station, bs, is_, fs)\n\n# Calculate reduced levels using HPC algorithm\nleveling.compute_heights(method=\"hpc\")\nprint(f\"\\n\\nNumber of instrument station = {leveling.numberSTN}\\n\")\n\n# Perform arithmetic checks\narithmetic_results = leveling.arithmetic_check()\n\nprint(\"\\nArithmetic Checks:\")\nprint(f\"Sum of BS = {arithmetic_results['sum_bs']:.3f}\")\nprint(f\"Sum of FS = {arithmetic_results['sum_fs']:.3f}\")\nprint(f\"First RL = {arithmetic_results['first_rl']:.3f}\")\nprint(f\"Last RL = {arithmetic_results['last_rl']:.3f}\")\nprint(f\"Sum of BS - Sum of FS = {arithmetic_results['bs_minus_fs']:.4f}\")\nprint(f\"Last RL - First RL = {arithmetic_results['last_rl_minus_first_rl']:.4f}\")\n\nif arithmetic_results['is_arithmetic_check_passed']:\n    print(\"Arithmetic Checks are OK.\")\nelse:\n    diff = arithmetic_results['bs_minus_fs'] - arithmetic_results['last_rl_minus_first_rl']\n    print(f\"Arithmetic Checks failed with {diff:.4f} differences\")\n\nprint(f\"\\nAllowable misclose = {leveling.allowable_misclose():.4f} mm\")\nprint(f\"Misclose = {leveling.misclose:.4f} m ({leveling.misclose * 1000:.4f} mm)\" if leveling.misclose is not None else None)\nprint(f\"Leveling Status: {'Work is accepted' if leveling.is_work_accepted() else 'Work is not accepted'}.\\n\")\n\nprint(f\"Correction = {round(leveling.correction,5) if leveling.correction is not None else None}\")\nprint(f\"Correction per station = {round(leveling.adjustment_per_station,5) if leveling.adjustment_per_station is not None else None}\\n\")\n\n#Print HPC table\nprint(\"HPC:\",leveling.get_dataFrame())\n\n```\n\n## Calculate reduced levels using Rise & Fall algorithm\n\n```python\nleveling.compute_heights(method=\"rise_fall\")\nprint(leveling.misclose)        # Print the misclose\nprint(leveling.adjustedRLs)     # Prints the adjusted RLs\n\n#Include the rounding decimal points\nprint(\"Rise & Fall:\\n\",leveling.get_dataFrame(roundDigits=5))\n\n```\n\n# Geodesy\n\n```python\nfrom geocalc import Geodesy\n\n# Calculate distance and bearing between two points\npoint_a = (12.4924, 41.8902)  # Colosseum, Rome\npoint_b = (2.2945, 48.8582)   # Eiffel Tower, Paris\n\ndistance, bearing = Geodesy.distance_and_bearing(point_a, point_b)\n```\n\n```python\ngeodesy = Geodesy()\n\n# Haversine distance\ndistance1 = geodesy.haversine_distance(40.689247, -74.044502, 48.858844, 2.294351)\nprint(f\"Haversine distance: {distance1} meters\")\n\n# Vincenty distance\ndistance2 = geodesy.vincenty_distance(40.689247, -74.044502, 48.858844, 2.294351)\nprint(f\"Vincenty distance: {distance2} meters\")\n\n# Area of geodesic polygon\npolygon_coordinates = [(30, 0), (30, 10), (40, 10), (40, 0)]\narea = geodesy.area_of_geodesic_polygon(polygon_coordinates)\nprint(f\"Area of geodesic polygon: {area} square meters\")\n```\n\n## Contributing\n\nIf you'd like to contribute to GeoCalc, please open an issue or submit a pull request on the GitHub repository.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Charles Gameti  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A library for geometric calculations",
    "version": "0.0.2",
    "split_keywords": [
        "python",
        "geomatic",
        "levelling",
        "curves",
        "geodesy",
        "polygon",
        "triangle",
        "horizontal",
        "vertical"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9fe5126e68c78f9bb317156748fa3be8d4b50d4d3543ba7da35917587a7e17cb",
                "md5": "552b412750e42ff7accd3b92ffebf633",
                "sha256": "a02e3aebda1846722e1b452caf6976584c05fac2a4c2392682afcef90cede348"
            },
            "downloads": -1,
            "filename": "geocalc-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "552b412750e42ff7accd3b92ffebf633",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6170,
            "upload_time": "2023-04-26T15:16:20",
            "upload_time_iso_8601": "2023-04-26T15:16:20.788167Z",
            "url": "https://files.pythonhosted.org/packages/9f/e5/126e68c78f9bb317156748fa3be8d4b50d4d3543ba7da35917587a7e17cb/geocalc-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "128966276b30feddd31f25a180d4997b70bf986f04469cdec14702eed52a5518",
                "md5": "1eb2445b71ba19d83b19176cf8014299",
                "sha256": "317bf31970a385ce36af4d6ba56524ce3e39987848ea47a4c7168f8dfec5cfa6"
            },
            "downloads": -1,
            "filename": "geocalc-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1eb2445b71ba19d83b19176cf8014299",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6707,
            "upload_time": "2023-04-26T15:16:24",
            "upload_time_iso_8601": "2023-04-26T15:16:24.856587Z",
            "url": "https://files.pythonhosted.org/packages/12/89/66276b30feddd31f25a180d4997b70bf986f04469cdec14702eed52a5518/geocalc-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-26 15:16:24",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "geocalc"
}
        
Elapsed time: 0.08787s