Name

magSq()

Examples
v = PVector(20.0, 30.0, 40.0)
m = v.magSq()
print(m)  # Prints "2900.0"
Description Calculates the magnitude (length) of the vector, squared. This method is often used to improve performance since, unlike mag(), it does not require a sqrt() operation.
Related mag()

Updated on Thu Oct 22 12:07:48 2026.

If you see any errors or have comments, please let us know.