Skip to main content

A simple coordinate geometry helper package

Project description

ci-cd codecov Documentation Status

coordgeompy

A simple coordinate geometry helper package. This package is developed for the UBC MDS DSCI 524 Collaborative Software Development course at the University of British Columbia.

Overview

This starter package allows users to perform various geometric operations like calculate distance between two parallel lines, distance between two n dimensional vectors, intersection of lines in 3-Dimensional space and so on. Our motivation in creating this package was to allow users with minimal experience in python coding to be able to perform these geometric calculations easily.

Installation

$ pip install git+https://github.com/UBC-MDS/CoordGeomPy.git@v1.0.0

Features

There are four main functions planned for development as outlined below. Additional functions may be added in the future.

Function 1 dist_pll_lines_2d: This function allows a user to calculate the distance between two parallel lines. This is the distance between the points where a perpendicular line intersects between the two parallel lines. This function will find that distance (d).

Function 2 get_distance: This function allows a user to calculate the the distance between two n dimensional vectors. Possible metrics that can be used with this function includes: Euclidean, Manhattan, Chebyshev, or Minkowski

Function 3 is_intersection_3d: This function allows a user to determine whether two infinite lines intersect in 3-dimensional space. The function will return True or False based on the input arguments.

Function 4 is_orthogonal: This function allows a user to determine whether two infinite lines are perpendicular in n-dimensional space. The function will return True or False based on the input arguments.

While we are not really reinventing the wheel on coordinate geometry calculations with our package, we used this as an opportunity to gain some experience in understanding how these calculations function in python language. There are existing packages that execute similar functions. For example, SymPy is a Python library that contains comprehensive mathematical functions including intersection of lines, shortest distance between a point and a line etc. We also found a package coordinate-geometry 1.0.02 that had similar functions to calculating distance between two points, a point and a line, area of a triangle etc. Scipy's scipy.spatial.distance.cdist functions similarly to Function 2.

Usage

import numpy as np
from coordgeompy.coordgeompy import dist_pll_lines_2d
from coordgeompy.coordgeompy import get_distance
from coordgeompy.coordgeompy import is_intersection_3d
from coordgeompy.coordgeompy import is_orthogonal

x1 <- c(1, 2, 3, 4)
x2 <- c(5, 6, 7, 8)
get_distance(x1, x2, metric="Euclidean")

Documentation

The official documentation is hosted on Read the Docs

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Contributors

We welcome and recognize all contributors. Names and GitHub @usernames listed below:

  • Arlin Cherian: @arlincherian
  • Nico Van Den Hooff: @nicovandenhooff
  • Zheren Xu: @ZherenXu
  • Jordan Casoli: @jcasoli

License

coordgeompy was created by Jordan Casoli, Nico Van Den Hooff, Arlin Cherian and Zheren Xu. It is licensed under the terms of the License: MIT

Credits

coordgeompy was created with cookiecutter and the py-pkgs-cookiecutter template.

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

coordgeompy-1.0.10.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

coordgeompy-1.0.10-py3-none-any.whl (6.2 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