Recreation of Unity's Vectors structs in python. Can be used for maths, physic, simulations, games...
it's composed of 2 main classes:
- Vector2 (2D)
- Vector3 (3D)
Might not be 100% accurate, this is still in devloppment.
Feel free to open issue request if you find bugs.
Representation of 2D vectors and points. https://docs.unity3d.com/ScriptReference/Vector2.html
x -> float
y -> float
Returns the length/intensity/norm of this vector (Read Only)
-> float
X Component of the vector
-> float | int | bytes
Y Component of the vector
-> float | int | bytes
Vector2(0, -1)
Vector2(-1, 0)
Vector2(1, 1)
Vector2(1, 0)
Vector2(0, 1)
Vector2(0, 0)
Calculates the lowest angle between va and vb in degrees
va -> Vector2
vb -> Vector2
--> float
Calculates the distance between va and vb
va -> Vector2
vb -> Vector2
--> float
Lerp between vector A and vector B
va -> Vector2
vb -> Vector2
t -> float clamped between 0 and 1
--> Vector2
Representation of 3D vectors and points. https://docs.unity3d.com/ScriptReference/Vector3.html
x -> float
y -> float
z -> float
Returns the length (norm) of this vector (Read Only)
--> float
X Component of the vector
-> float | int | bytes
Y Component of the vector
-> float | int | bytes
Z Component of the vector
-> float | int | bytes
Vector3(0, 0, -1)
Vector3(0, -1, 0)
Vector3(0, 0, 1)
Vector3(-1, 0, 0)
Vector3(1, 1, 1)
Vector3(1, 0, 0)
Vector3(0, 1, 0)
Vector3(0, 0, 0)
Calculates the lowest angle between va and vb in degrees
va -> Vector3
vb -> Vector3
--> float
Calculates the distance between va and vb
va -> Vector3
vb -> Vector3
--> float
Lerp between vector A and vector B
va -> Vector3
vb -> Vector3
t -> float clamped between 0 and 1
--> Vector3
return the dot product of va.vb
--> float