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.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for vectorlib_py-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdb7fa47d6a1e8e92dce4a641a5707fae2fd8886cb9d9f9b237cccbe4a57ccbd |
|
MD5 | da26d7559a208680d67fadb42092fc0a |
|
BLAKE2b-256 | e8d49f4ed7c10d74efb70fd848767eaae17c3ca81411140d6c1e846051810b2f |