Py5Vector.dim

Py5Vector.dim

The vector’s dimension.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
v_2d = py5.Py5Vector(1, 2)
v_3d = py5.Py5Vector(1, 2, 3)
v_4d = py5.Py5Vector(1, 2, 3, 4)

print("dim =", v_2d.dim)
# dim = 2
print("dim =", v_3d.dim)
# dim = 3
print("dim =", v_4d.dim)
# dim = 4

Description

The vector’s dimension. This will be either 2, 3, or 4.

Updated on January 16, 2022 16:51:21pm UTC