vectormath
Project description
Vector math utilities for Python.
import numpy as np
import vectormath as vmath
# Simple vectors
v = vmath.Vector3(5, 0, 0)
v.normalize()
print(v) # > [[1, 0, 0]]
print(v.x, type(v.x)) # > 1.0, float
# Array based vectors are much faster than a for loop
v_array = vmath.Vector3([[4,0,0],[0,2,0]])
print(v_array.x) # > [4, 0]
# we can
print(v_array.length) # [4, 2]
print(v_array.normalize()) # [[1,0,0],[0,1,0]]
# These vectors are just numpy arrays
assert isinstance(v, np.ndarray)
Major classes include Vector3
, Matrix3
, Plane
, Parallelogram
.
Current version: v0.0.3
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
vectormath-0.0.3.tar.gz
(7.1 kB
view details)
File details
Details for the file vectormath-0.0.3.tar.gz
.
File metadata
- Download URL: vectormath-0.0.3.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c5e05c69bdc83a10f37c4c4d67faa5415238930126e8da4848b922dab9352fa |
|
MD5 | 6894e201f29b514552caab67cf3ce474 |
|
BLAKE2b-256 | 4f0a23b0038b4038e0d9fde8b74077b1910fa088b68066efd9efa8c9eb32c941 |