https://github.com/jnyjny/twod
A Two-Dimensional Geometry Library for Humans™
https://github.com/jnyjny/twod
2-d 2-dimension 2d dataclasses geometry python python3 python3-library two-dimensional vector-math
Last synced: about 1 month ago
JSON representation
A Two-Dimensional Geometry Library for Humans™
- Host: GitHub
- URL: https://github.com/jnyjny/twod
- Owner: JnyJny
- License: apache-2.0
- Created: 2018-11-09T14:05:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-07-09T03:45:34.000Z (3 months ago)
- Last Synced: 2025-08-19T06:38:11.452Z (about 2 months ago)
- Topics: 2-d, 2-dimension, 2d, dataclasses, geometry, python, python3, python3-library, two-dimensional, vector-math
- Language: HTML
- Homepage:
- Size: 871 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twod - A Two-Dimensional Geometry Library for Humans™
[![Test & Publish][release-badge]][release]
![Version][pypi-version]
![Release Date][release-date]
![Python Version][python-version]
![License][license]
![Code Style: black][code-style-black]
![Monthly Downloads][monthly-downloads][twod][0] (pronounced "two dee") is a geometry library that supplies
simple two-dimensional geometric primtives:- `twod.Point`
- `twod.Rect`## Install
Installing `twod` is a snap!
```console
$ python3 -m pip install -U twod
```## Development Workflow
```console
$ git clone https://github.com/JnyJny/twod.git
$ cd twod
$ poetry shell
...
(twod-...) $
```## Usage Examples
```python
from twod import Point
o = Point()
b = Point.from_polar(10, 0)
assert b.distance(o) == 10.0
```[0]: https://github.com/JnyJny/twod.git
[pypi-version]: https://img.shields.io/pypi/v/twod
[python-version]: https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FJnyJny%2Ftwod%2Fmaster%2Fpyproject.toml
[license]: https://img.shields.io/pypi/l/twod
[dependencies]: https://img.shields.io/librariesio/github/JnyJny/twod
[monthly-downloads]: https://img.shields.io/pypi/dm/twod
[release-date]: https://img.shields.io/github/release-date/JnyJny/twod
[code-style-black]: https://img.shields.io/badge/code%20style-black-000000.svg
[release-badge]: https://github.com/JnyJny/twod/actions/workflows/release.yaml/badge.svg
[release]: https://github.com/JnyJny/twod/actions/workflows/release.yaml