This module makes working with vectors (or other tuple-ish things) much more convinient.
It introduces a new datatype (actually a class) called Vector which is a lot like tuples.
These vectors can contain from 1 to 4 dimensions (x, y, z, t) and these can be called and changed easily.
The addition (and subtraction, multiplication and so on) of a vector, integer, float or list to another vector is as easy as working with integers and floats. See below, or example.py for examples. (example.py is far more detailed.)
No more annoying iteration and inefficient code whilts working with tuples thanks to this module!
>>> from vectors import *
>>> myvector = Vector(1,2,3)
>>>
>>> print(myvector)
(1, 2, 3)
>>> print(myvector.x)
1
>>> print(myvector[0])
1
>>> print(myvector.type)
'vector3'
>>> print(vtype(myvector))
'vector3'
>>>
>>> myvector += 1
(2, 3, 4)
>>>
>>> othervector = Vector(4, 5, 6)
>>>
>>> myvector + othervector
(6, 7, 10)
>>> myvector / [3, 2, 0.5]
(2, 3.5, 20)
>>>
>>> mytuple = unv(myvector)
>>> print(mytuple, type(mytuple))
(2, 3.5, 20), <class 'tuple'>
>>>
>>> myvec = Vector(mytuple)
>>>
>>> mymag = mag(myvec)
'returns magnitude'
>>> mynorm = normalized(myvec)
'returns normalized vector'
>>> print(myvec.positive())
'returns all-positive vector'
Metadata
Release files for easyvectors 1.0.2
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 | |
|---|---|---|---|---|
| easyvectors-1.0.2.tar.gz | 5.7 kB | Without provenance | Details |
Release files / easyvectors-1.0.2.tar.gz
| Download URL | easyvectors-1.0.2.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2dcce5edf5c09c47c5945ff23d4bf5afdd068673d228f9684ad488181a048bac
|
|
BLAKE2b-256 checksum How to use checksums |
43cd6a898f059ad531206f157ca83468ca0f121c8fd3216d3891d7a60ffd0f97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.3
|
Security for easyvectors 1.0.2
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.