{ "info": { "author": "Jan M\u00fcller", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# geometer\n\n[![image](https://img.shields.io/pypi/v/geometer.svg)](https://pypi.org/project/geometer/)\n[![image](https://img.shields.io/pypi/l/geometer.svg)](https://pypi.org/project/geometer/)\n[![image](https://img.shields.io/pypi/pyversions/geometer.svg)](https://pypi.org/project/geometer/)\n[![Build Status](https://travis-ci.org/jan-mue/geometer.svg?branch=master)](https://travis-ci.org/jan-mue/geometer)\n[![codecov](https://codecov.io/github/jan-mue/geometer/coverage.svg?branch=master)](https://codecov.io/github/jan-mue/geometer)\n\nGeometer is a geometry library for Python 3 that uses projective geometry and numpy for fast geometric computation.\nIn projective geometry every point in 2D is represented by a three-dimensional vector and every point in 3D\nis represented by a four-dimensional vector. This has the following advantages:\n\n- There are points at infinity that can be treated just like normal points.\n- Projective transformations are described by matrices but they can also\n represent affine transformations i.e. also translations.\n- Every two lines have a unique point of intersection if they lie in the same\n plane. Parallel lines have a point of intersection at infinity.\n- Points of intersection, planes or lines through given points can be\n calculated using simple cross products or tensor diagrams.\n- Special complex points at infinity and cross ratios can be used to calculate\n angles and to construct perpendicular geometric structures.\n\nMost of the computation in the library is done via tensor diagrams (using numpy.einsum).\n\nGeometer was originally built as a learning exercise and is based on two graduate courses taught at the\nTechnical University Munich. After investing a lot of time in the project, it is now reasonably well tested\nand the API should be stable.\n\nThe source code of the package can be found on [GitHub](https://github.com/jan-mue/geometer)\nand the documentation on [Read the Docs](https://geometer.readthedocs.io).\n\n## Installation\n\nYou can install the package directly from PyPI:\n```bash\npip install geometer\n```\n\n## Usage\n\n```Python\nfrom geometer import *\nimport numpy as np\n\n# Meet and Join operations\np = Point(2, 4)\nq = Point(3, 5)\nl = Line(p, q)\nm = Line(0, 1, 0)\nl.meet(m)\n# Point(-2, 0)\n\n# Parallel and perpendicular lines\nm = l.parallel(through=Point(1, 1))\nn = l.perpendicular(through=Point(1, 1))\nis_perpendicular(m, n)\n# True\n\n# Angles and distances (euclidean)\na = angle(l, Point(1, 0))\np + 2*dist(p, q)*Point(np.cos(a), np.sin(a))\n# Point(4, 6)\n\n# Transformations\nt1 = translation(0, -1)\nt2 = rotation(-np.pi)\nt1*t2*p\n# Point(-2, -5)\n\n# Ellipses/Quadratic forms\na = Point(-1, 0)\nb = Point(0, 3)\nc = Point(1, 2)\nd = Point(2, 1)\ne = Point(0, -1)\n\nconic = Conic.from_points(a, b, c, d, e)\nellipse = Conic.from_foci(c, d, bound=b)\n\n# Geometric shapes\no = Point(0, 0)\nx, y = Point(1, 0), Point(0, 1)\nr = Rectangle(o, x, x+y, y)\nr.area\n# 1\n\n# 3-dimensional objects\np1 = Point(1, 1, 0)\np2 = Point(2, 1, 0)\np3 = Point(3, 4, 0)\nl = p1.join(p2)\nA = join(l, p3)\nA.project(Point(3, 4, 5))\n# Point(3, 4, 0)\n\nl = Line(Point(1, 2, 3), Point(3, 4, 5))\nA.meet(l)\n# Point(-2, -1, 0)\n\np3 = Point(1, 2, 1)\np4 = Point(1, 1, 2)\nc = Cuboid(p1, p2, p3, p4)\nc.area\n# 6\n\n# Cross ratios\nt = rotation(np.pi/16)\ncrossratio(q, t*q, t**2 * q, t**3 * q, p)\n# 2.093706208978352\n\n# Higher dimensions\np1 = Point(1, 1, 4, 0)\np2 = Point(2, 1, 5, 0)\np3 = Point(3, 4, 6, 0)\np4 = Point(0, 2, 7, 0)\nE = Plane(p1, p2, p3, p4)\nl = Line(Point(0, 0, 0, 0), Point(1, 2, 3, 4))\nE.meet(l)\n# Point(0, 0, 0, 0)\n\n```\n\n## References\n\nMany of the algorithms and formulas implemented in the package are taken from\nthe following books and papers:\n\n- J\u00fcrgen Richter-Gebert, Perspectives on Projective Geometry\n- J\u00fcrgen Richter-Gebert and Thorsten Orendt, Geometriekalk\u00fcle\n- Olivier Faugeras, Three-Dimensional Computer Vision\n- Jim Blinn, Lines in Space: The 4D Cross Product\n- Jim Blinn, Lines in Space: The Line Formulation\n- Jim Blinn, Lines in Space: The Two Matrices\n- Jim Blinn, Lines in Space: Back to the Diagrams\n- Jim Blinn, Lines in Space: A Tale of Two Lines\n- Jim Blinn, Lines in Space: Our Friend the Hyperbolic Paraboloid\n- Jim Blinn, Lines in Space: The Algebra of Tinkertoys\n- Jim Blinn, Lines in Space: Line(s) through Four Lines\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jan-mue/geometer", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "geometer", "package_url": "https://pypi.org/project/geometer/", "platform": "", "project_url": "https://pypi.org/project/geometer/", "project_urls": { "Homepage": "https://github.com/jan-mue/geometer" }, "release_url": "https://pypi.org/project/geometer/0.2.0/", "requires_dist": [ "numpy (<1.18,>=1.15)", "sympy (<=1.4,>=1.3)" ], "requires_python": ">=3.5.0", "summary": "Python geometry package based on projective geometry and numpy.", "version": "0.2.0" }, "last_serial": 5832691, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "baf73a10a3b8bc70372031e22c738105", "sha256": "8cf63c2bad85a0035e11122681e699a625fb2a59261dce7e229c6235bd590ab7" }, "downloads": -1, "filename": "geometer-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "baf73a10a3b8bc70372031e22c738105", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.0", "size": 14530, "upload_time": "2019-01-05T18:38:05", "url": "https://files.pythonhosted.org/packages/49/b3/bc058318b8f318e5338cce8a993bf8bad4dca4ed438ccc6b5c100c50357f/geometer-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7d26d9e5a0c7dff8156a0dd25051fc65", "sha256": "4ee8fa4a52173281b62f4982d76e45936575931e3e78e7bcb27b6bf952b63210" }, "downloads": -1, "filename": "geometer-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7d26d9e5a0c7dff8156a0dd25051fc65", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.0", "size": 15409, "upload_time": "2019-01-05T18:38:06", "url": "https://files.pythonhosted.org/packages/be/a5/840db4193af2a2125214124787f08978c73b0ede45707a0bd4b4e4258f07/geometer-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e036b9fbfad9699e8ee5927e1437d663", "sha256": "52e602fbed5cf53124f4daf38ac2c0ac1a88a2a7fb8e825b46dd0c1baf251a1b" }, "downloads": -1, "filename": "geometer-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e036b9fbfad9699e8ee5927e1437d663", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.0", "size": 18419, "upload_time": "2019-02-02T01:08:14", "url": "https://files.pythonhosted.org/packages/7f/a6/fd194b769e67ebe1d40458c777293127a35b3875793e3836c939d3692c7b/geometer-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ea12a52bb3c4b6dabcff7209785486bf", "sha256": "b8b1db87ee42872f8b9f4de4de5478dfc652fe302d6e1a7fcb9a8ac864b90ba4" }, "downloads": -1, "filename": "geometer-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ea12a52bb3c4b6dabcff7209785486bf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.0", "size": 18649, "upload_time": "2019-02-02T01:08:15", "url": "https://files.pythonhosted.org/packages/24/5b/64f106b0c83f2100aa5362698dc826c8dfcd45ee20d89597a22afdba49ae/geometer-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3b5b4e2640942f6612f13253b89e85e7", "sha256": "22cbe8676c2fe060e9679e48f004ddf4d28933c187e5ba056bc2f705bc8aca1b" }, "downloads": -1, "filename": "geometer-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3b5b4e2640942f6612f13253b89e85e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.0", "size": 20462, "upload_time": "2019-02-24T17:20:09", "url": "https://files.pythonhosted.org/packages/b1/ad/c0c7d1f9b7dcf0d0ed48195d38c77a6db41f114f503771a60d7cddab5401/geometer-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f4f309b40ea5d2c50cc5df43bca96b66", "sha256": "03c3db58809e512da38f5d3c225642b2ab595a795329a9647e38d8cf4d4f2621" }, "downloads": -1, "filename": "geometer-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f4f309b40ea5d2c50cc5df43bca96b66", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.0", "size": 19422, "upload_time": "2019-02-24T17:20:10", "url": "https://files.pythonhosted.org/packages/88/6a/af5e4b2ebe6f6f6c9ba168919c7bef263a073d1d0b19a98a8254c0603e0b/geometer-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7827ab3f17765e06b06e739acfdf8432", "sha256": "8f61cbff77177bf1b59ca049029771adbb5e03e018b824a97725ca02993848c9" }, "downloads": -1, "filename": "geometer-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7827ab3f17765e06b06e739acfdf8432", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.0", "size": 31419, "upload_time": "2019-09-15T18:02:00", "url": "https://files.pythonhosted.org/packages/1d/61/d44f842b2a3edd5849fcb76182623f386017a4d2754e6de727daca0b4344/geometer-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dbf31171282556531afe9bc65899c9e3", "sha256": "09db1182d731eabf762eb2a721ade1604dde4c299d82c8d609af4fa687cc3003" }, "downloads": -1, "filename": "geometer-0.2.0.tar.gz", "has_sig": false, "md5_digest": "dbf31171282556531afe9bc65899c9e3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.0", "size": 29391, "upload_time": "2019-09-15T18:02:01", "url": "https://files.pythonhosted.org/packages/8c/4e/834bc02dcc9093fd46263f735f002c315f18d1c6b8cdf6e82b5da2865eaf/geometer-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7827ab3f17765e06b06e739acfdf8432", "sha256": "8f61cbff77177bf1b59ca049029771adbb5e03e018b824a97725ca02993848c9" }, "downloads": -1, "filename": "geometer-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7827ab3f17765e06b06e739acfdf8432", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.0", "size": 31419, "upload_time": "2019-09-15T18:02:00", "url": "https://files.pythonhosted.org/packages/1d/61/d44f842b2a3edd5849fcb76182623f386017a4d2754e6de727daca0b4344/geometer-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dbf31171282556531afe9bc65899c9e3", "sha256": "09db1182d731eabf762eb2a721ade1604dde4c299d82c8d609af4fa687cc3003" }, "downloads": -1, "filename": "geometer-0.2.0.tar.gz", "has_sig": false, "md5_digest": "dbf31171282556531afe9bc65899c9e3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.0", "size": 29391, "upload_time": "2019-09-15T18:02:01", "url": "https://files.pythonhosted.org/packages/8c/4e/834bc02dcc9093fd46263f735f002c315f18d1c6b8cdf6e82b5da2865eaf/geometer-0.2.0.tar.gz" } ] }