Skip to main content

geompreds - A Python wrapper for 2D predicates of Jonathan Richard Shewchuk

Many computational geometry applications use numerical tests known as the orientation and incircle tests. The orientation test determines whether a point lies to the left of, to the right of, or on a line or plane defined by other points. The incircle test determines whether a point lies inside, outside, or on a circle defined by other points. [Adaptive Precision Floating-Point Arithmetic and Fast Robust Predicates for Computational Geometry].

Installation

  • Download the source

  • Run python setup.py install (or python setup.py develop)

  • Run python test/test_predicates.py to run the tests.

Usage

>>> from geompreds import orient2d, incircle
>>> orient2d( (0, 0), (10, 0), (10, 10)) # left turn (positive), looking from above
100.0
>>> orient2d( (0, 0), (10, 0), (20, 0)) # straight (zero)
0.0
>>> orient2d( (0, 0), (10, 0), (10, -10)) # right turn (negative), looking from above
-100.0
>>> incircle((0,0), (10,0), (0,10), (0,10)) # on boundary
0.0
>>> incircle((0,0), (10,0), (0,10), (1,1)) # inside, value positive
1800.0
>>> incircle((0,0), (10,0), (0,10), (-100,-100)) # outside, value negative
-2200000.0

Changelog

See CHANGES.txt.

Bug reports

If you discover any bugs, feel free to create an issue on Bitbucket.

Please add as much information as possible to help us fixing the possible bug. We also encourage you to help even more by forking and sending us a pull request.

The issue tracker lives here.

Maintainers

License

MIT License

Metadata

Release files for geompreds 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geompreds 1.0.2
File Size Uploaded
geompreds-1.0.2.tar.gz 52.9 kB Details

Release files / geompreds-1.0.2.tar.gz

Download URL geompreds-1.0.2.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f6b48fe4c823a8c9249b52df9a8375fcf68b48b31a19bf5689c2ff9d6d8820fb
BLAKE2b-256 checksum
How to use checksums
d047c47deecf8f538fdac9661605dfd66727c77f5bcea3ab93ba5268a1ce0a8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page