Simple immutable vectors.
Project description
Package: generalvector
Vectors made by me, featuring Vec and Vec2, inspired by Expression 2* in Wiremod inside Garry's Mod.
The vectors are immutable, so any time a value inside one is changed it returns a new vector.
The bulk of the code is written twice, with one verion in vector and one version in vector2. I've begun adding new functions into general instead which both vectors inherit from to, make the code DRY. The General class can take an arbitrary amount of axis which allows us to easily add, for example, a Vec4 in the future if all code is moved to general.
*https://github.com/wiremod/wire/wiki/Expression-2
Installation
pip install generalvector
Usage example
from generalvector import Vec, Vec2
assert Vec(3) + 2 == Vec(5, 5, 5)
assert Vec2(3, 4).length() == 5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
generalvector-1.2.2.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for generalvector-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27b84fd4b8d24d731ca53b87370bc7abbd1b1110e40effd12a06c1df84a9f319 |
|
MD5 | 584dead021841e86da328f37998b6cde |
|
BLAKE2b-256 | c85b6e0f60f5efa5b50f5fe10c820baab9becc4bbd24aca0e95b33051028a17d |