Skip to main content

Adaptive Precision Floating-Point Arithmetic and Fast Robust Predicates for Computational Geometry for Python

Project description

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

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

geompreds-1.0.1.tar.gz (52.9 kB view details)

Uploaded Source

File details

Details for the file geompreds-1.0.1.tar.gz.

File metadata

  • Download URL: geompreds-1.0.1.tar.gz
  • Upload date:
  • Size: 52.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for geompreds-1.0.1.tar.gz
Algorithm Hash digest
SHA256 abcf06119efdbcf702bc1e8c7456f37f212b1a20ca54e6afdb19a3bb9ec1bee9
MD5 3c9d542b92672af5115d0985b130373e
BLAKE2b-256 6411f3794d3e9ce6990a1dc3722dbd96f80eb1950aaa815e51452aa0207ba127

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