Vector
Vector math utils.
import nvtools as nv
# create new vectors
a = nv.Vector(1, -1, 1)
b = nv.Vector(2, 1, -3)
# useful methods
a.length
a.angle(b)
a.scalar_product(b)
a.cross_product(b)
- class nvtools.vector.Vector(*args)[source]
N-dim Vector.
- property dim: float
Dimensionality.
- property length: float
Euclidian length.
- rotate(u: Vector, theta: float) Vector [source]
Rotate around arbitrary axis.
- Parameters:
u (Vector) – Rotation axis (Vector of arbitrary length)
theta (float) – Rotation angle in radians
- property x
X component.
- property y
Y component.
- property z
Z component.