A vector library to contain and manipulate 2D and 3D points.
Project description
Usage
- To import everything:
import vectors
- To import only 2D and 3D points:
from vectors import Vector2, Vector3
- Get point information:
_.x
or_.y
or if Vector3,_.z
- Get all points as a tuple:
_.tuple()
- Get all points as an array list:
_.list()
- Get all points as a dictionary:
_.dict()
- Add two points:
vectors.add(<v1>, <v2>)
- Subtract two points:
vectors.subtract(<v1>, <v2>)
- Multiply two points:
vectors.multiply(<v1>, <v2>)
- Divide two points:
vectors.divide(<v1>, <v2>)
Usage Notes:
- You can add, subtract, multiply, and divide a
Vector2
and aVector3
(and vice versa). The output will be converted to a Vector3, using0 <operator> <second_param>.z
as the z value - IMPORTANT: Remember when dividing, you cannot divide by zero.
0 / 2
is valid, however2 / 0
is not. If your second parameter has a 0, you WILL get an error
Updates
11/18/2020 - 1.1.1-1.1.2
Updated README.md
11/18/2020 - 1.1.0
Added add, subtract, multiply, and dividing of Vector2 and Vector3
11/18/2020 - 1.0.0
Fixed Vector3.tuple()
showing as (x, y, x)
instead of (x, y, z)
11/17/2020 - 0.0.1
Package published
Other Information
See my other projects at https://fosterreichert.com
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
python-vectors-1.1.2.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for python_vectors-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b51f7d8e22e9359a5b83ded4d1ae3f6efeed2a4fb57868c952c0ba98de07125 |
|
MD5 | 7b7a780ea85edc623cd5e7bf03259242 |
|
BLAKE2b-256 | db73728e8de3fc7aac816ffa4143e26052630f53fdaa86cc883556c03a4b1c7f |