Skip to main content

Creates convex hulls of 2-d arrays

Project description

CONVEXPANOU

The purpose of this package is to provide a method called convex_hull_polygon which consists of three main functions (it includes other supportive as well), with input a set of 2d points .

The three main functions are:

1) A function named convex_hull_from_points with input with output the set of 2-d points which form the convex hull polygon enclosing all the points of the original 2-d set provided as input. For example, if datapoints is your set of 2-d points, convexpanou.convex_hull_polygon(datapoints).convex_hull_from_points() returns the set of 2-d points that forms the convex_hull_polygon thath surrounds all the points of the original dataset. The convex_hull is calculated using the graham scan algorithm. It is mandatory to provide a 2-d array consisting of at least one point.

2) A function named point_is_in_polygon with input, a single 2d point output: True or False, depending on whether the point lies inside / on the convex polygon (true) OR outside the polygon (false) provided originally as the 2-d set input of points in the method. For example, if datapoints is your convex hull polygon and p is your point,, if you want to find out whether p lies inside datapoints, you call convexpanou.convex_hull_polygon(datapoints).point_is_in_polygon(p). Please mind the following:

a) When trying to find out whether a 2-d point is into the convex _hull inserted (using the function point_is_in_polygon of convex_hull_graham method), if the point lies in the boundaries of the polygon, it returns False as if the point is NOT into the polygon.

b) The function does not check whether the points provided as a 2-d array convex -hull polygon, actually do form a convex hull polygon. If you are not sure, please implement the function convex_hull_from_points first.

c) It is mandatory to provide as input point in the function point_is_in_polygon an array of (1,2) shape.

3) A function named do_intersect with input: two convex polygons and output: true or false, depending on whether the two provided polygons intersect. For example, if datapoints is your first convex hull polygon and datapoints2 is your second convex hull polygon and you want to find out whether these two do intersect, you call pointconvexpanou.convex_hull_polygon(datapoints).do_intersect(datapoints2). Please mind the following:

a) The function does not check whether the points provided as a 2-d array convex -hull polygons, actually do form convex hull polygons. If you are not sure, please implement the function convex_hull_from_points first in both 2-d sets of points.

b) If one convex_hull_polygon is completely inside the other one, the function returns True as these two polygons do intersect

Other supportive functions of the method are:

a) plt_graham_convex() which plots the whole set of points and forms the convex_hull_polygon that surrounds them.

b) plt_in_or_out(p) with input a point p (an array shaped (1,2)), which plots the convex_hull_polygon provided as well as the point p

c) plt_in_or_out_conv (datapoints2) which plots both convex_hull_polygons provided as input in order to visualize whether they do intersect or not

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

convexpanou-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

convexpanou-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file convexpanou-0.1.0.tar.gz.

File metadata

  • Download URL: convexpanou-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for convexpanou-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac7923c602213bc643fd81fcf632a8cd1e89fcb926bd1ed7471c678a255192cb
MD5 640547f1a2f1bf1fd4e286a49088d8f2
BLAKE2b-256 651b064b11dbc41a14b35ee3ed71f8c41e3a5e927585f65f9b89c7267e50731f

See more details on using hashes here.

File details

Details for the file convexpanou-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: convexpanou-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for convexpanou-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47cf78d2b08dc24910c2dedc47358f5c1962dd6c0c90c59c5643f1653f76e8b2
MD5 5e1f1336b9737dd45268e601f0a57801
BLAKE2b-256 78fdaf33e923b5e800125a1f1f3cd51eda59ccc8f3cb954bb1b52f459c91c30b

See more details on using hashes here.

Supported by

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