magnitude
magnitude
gets/sets the length of the vector.
Type: float
Sample
Code
################### Get magnitude
# import Mathutils
import Mathutils
# create a vector
vect1 = Mathutils.Vector(1.0, 0.0, 0.0)
# get magnitude
vectMag = vect1.magnitude
################### Set magnitude
# import Mathutils
import Mathutils
# create a vector
vect1 = Mathutils.Vector(1.0, 0.0, 0.0)
# set magnitude
vect1.magnitude = 2.0
|