Skip to main content

inpoly-cython / Original: https://github.com/dengwirda/inpoly-python

Project description

inpoly-cython / Original: https://github.com/dengwirda/inpoly-python

$pip install inpoly-cython



Project from: https://github.com/dengwirda/inpoly-python

I only added the automatic compilation of the fast kernels: https://github.com/dengwirda/inpoly-python#fast-kernels





License Terms (from https://github.com/dengwirda/inpoly-python)

This program may be freely redistributed under the condition that the copyright notices (including this entire header) are not removed, and no compensation is received through use of the software. Private, research, and institutional use is free. You may distribute modified versions of this code UNDER THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution of this code as part of a commercial system is permissible ONLY BY DIRECT ARRANGEMENT WITH THE AUTHOR. (If you are not directly supplying this code to a customer, and you are instead telling them how they can obtain it for free, then you are not required to make any arrangement with me.)



DISCLAIMER: Neither I nor the University of Sydney warrant this code in any way whatsoever. This code is provided "as-is" to be used at your own risk.



Example: 



from inpoly_cython import inpoly2

import numpy as np

    

xmin, xmax, ymin, ymax = 0, 1, 0, 1

x0, y0, x1, y1 = 0.5, 0.5, 0, 1



#define any n-sided polygon

p = np.array([[xmin, ymin],

              [xmax, ymin],

              [xmax, ymax],

              [xmin, ymax],

              [xmin, ymin]])



#define some coords

coords = np.array([[x0, y0],

                   [x1, y1]])



#get boolean mask for points if in or on polygon perimeter

isin, ison = inpoly2(coords, p)

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

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

Source Distribution

inpoly_cython-0.10.tar.gz (12.4 kB view hashes)

Uploaded Source

Built Distribution

inpoly_cython-0.10-py3-none-any.whl (14.7 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