A library to create and manage vectors in Python.
Project description
VectorLib: A library to create and manage vectors in Python.
Installation
python -m pip install vectorlib-py
# or
python -m pip install git+https://github.com/AaravMalani/vectorlib
Usage
import vectorlib
u = vectorlib.Vector(0, 10)
v = vectorlib.Vector(-10, 0, 3)
t = 4
a_avg = (v-u)/t
print(a_avg) # Vector(-2.5, -2.5, 0.75)
print(a_avg.magnitude) # 3.61420807370024
print(a_avg.dim) # (3,)
print(a_avg.direction) # Vector(-0.6917144638660746, -0.6917144638660746, 0.2075143391598224)
m = 4
f = m * a
print(f) # Vector(-10.0, -10.0, 3.0)
print(f.dot(a_avg)) # 52.25
print(f.cross(a_avg)) # Vector(0.0, 0.0, 0.0)
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
vectorlib-py-1.0.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for vectorlib_py-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1d196bf6b51ff695aa9d1102ee28335f5c62f79975fd9c77298e07a243ea919 |
|
MD5 | d7e2d56106b2cf30828c5da2e00738b1 |
|
BLAKE2b-256 | 2b2516955ca4b4dba6bedc4c8c7f988abb4815564c83cbbcdbec96178e5443c9 |