Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 574 Bytes

py5vector_mag.md

File metadata and controls

33 lines (19 loc) · 574 Bytes

Py5Vector.mag

The vector's magnitude.

Examples

v1 = py5.Py5Vector(3, 4)

print("magnitude =", v1.mag)
# magnitude = 5.0

v1.mag = 1.0

print("magnitude =", v1.mag)
# magnitude = 1.0

Description

The vector's magnitude. Setting this property to a non-negative number will adjust the vector's magnitude to that value. Negative values will result in an error.

Updated on March 06, 2023 02:49:26am UTC