-
Notifications
You must be signed in to change notification settings - Fork 0
Home
shBLOCK edited this page Oct 3, 2023
·
11 revisions
Since the 6 vector classes are mostly similar, Vec3 is used in this part of the documentation, and methods specific to a class are particularized.
-
Vec3()
returns Vec3(0.0, 0.0, 0.0) -
Vec3(x: float, y: float, z: float)
returns Vec3(x, y, z) -
Vec3(vec: Vec3)
returns a copy of that vector -
Vec3(vec: Vec3i)
converts Vec3i to Vec3 - Any combination of vectors and numbers that has 3 dimensions in total is also supported.
Vec3(a: Vec2, b: float)
Vec3(a: float, b: Vec2)
We use a
and b
to represent vectors in this part.
a + b
a - b
-
a * b
multiplied each component ofa
andb
together -
a / b
divide each component ofa
byb
-
+a
returns a copy ofa
-
-a
returns the inverse vector ofa
-
a == b
a != b
check for exact equality -
a.is_close(b, rel_tol=1e-5, abs_tol=1e-14)
check for equality with tolerance (similar tomath.isclose()
) -
bool(a)
returnsTrue
ifa
is NOT a zero vector,False
otherwise