Usage
- To import everything:
import vectors - To import only 2D and 3D points:
from vectors import Vector2, Vector3, Slope - Create a 2D Vector:
v = Vector2(x, y) - Create a 3D vector:
v = Vector3(x, y, z) - Create a slope instance:
m = Slope(rise, run) - Get point information:
_.xor_.yor_.z - Get all points/rise and run as a tuple:
_.tuple() - Get all points/rise and run as an array list:
_.list() - Get all points/rise and run as a dictionary:
_.dict() - Get rise over run from slope object as a string formated as
rise/run:
_.string() - Add two points:
vectors.add(<v1>, <v2>)
_.add(v) - Subtract two points:
vectors.subtract(<v1>, <v2>)
_.subtract(v) - Multiply two points:
vectors.multiply(<v1>, <v2>)
_.multiply(v) - Divide two points:
vectors.divide(<v1>, <v2>)
_.divide(v) - Simplify slope rise and run:
_.simplify() - Generate a 2D vector matrix:
vectors.generate_2d_matrix(<Vector2>, <Vector2>) - Generate a 3D vector matrix:
vectors.generate_3d_matrix(<Vector3>, <Vector3>)
Usage Notes:
vectors.find_slope(<Vector2>, <Vector2>)returns a Slope classvectors.generate_2d_square_matrix(<Vector2>, <Vector2>)increments by one. This means your given Vector2 objects should only contain ints, no double or floats.- You can add, subtract, multiply, and divide a
Vector2and aVector3(and vice versa). The output will be converted to a Vector3, using0 <operator> <second_param>.zas the z value - IMPORTANT: Remember when dividing, you cannot divide by zero.
0 / 2is valid, however2 / 0is not. If your second parameter has a 0, you WILL get an error
Updates
11/18/2020 - 1.2.3
- Changed
vectors.generate_square_matrix(<Vector2>, <Vector2>)tovectors.generate_2d_matrix(<Vector2>, <Vector2> - Added
vectors.generate_3d_matrix(<Vector3>, <Vector3>)
11/18/2020 - 1.2.1
- Added inline math functions
- Added square matrix generation with
vectors.generate_square_matrix(<Vector2>, <Vector2>) - Added
Slopeclass - Added
vectors.find_slope(<Vector2>, <Vector2>),_.simplify(), and_.string()functions
11/18/2020 - 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
Metadata
Release files for python-vectors 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-vectors-1.2.3.tar.gz | 3.1 kB | Without provenance | Details for python-vectors-1.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_vectors-1.2.3-py3-none-any.whl | Python 3 | none | any | Details for python_vectors-1.2.3-py3-none-any.whl |
Total release size: 7.2 kB
Release files / python-vectors-1.2.3.tar.gz
| Download URL | python-vectors-1.2.3.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44c9f47eda634a84984a27d9c81447d457f252d2262be12dc91644aaba729c35
|
|
BLAKE2b-256 checksum How to use checksums |
54655fb5589d3d5e1769acc56e65c0f1cfbaca23b16340dd995e5baa90568f66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.3
|
Release files / python_vectors-1.2.3-py3-none-any.whl
| Download URL | python_vectors-1.2.3-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb6d0b066fcda0221147e1cb263433d1a6785a2a9f8c6b8d302269855799d3e6
|
|
BLAKE2b-256 checksum How to use checksums |
812667f106b9706c83c11b4ab90ba16af3517576ce767a8481b7acf21e7c0217
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.3
|
Security for python-vectors 1.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.