pymel.util.arrays.sqlength

sqlength(a, axis=None)

sqlength(a[, axis=(axis0, axis1, ...)]) –> numeric or Array

Returns square length of a, ie a*a or the sum of x*x for x in a if a is an iterable of numeric values. If a is an Array and axis are specified will return a list of sqlength(x) for x in a.axisiter(*axis).

>>> A = Array([[0.5,0.5,-0.707],[0.707,-0.707,0.0]])
>>> print A.formated()
[[0.5, 0.5, -0.707],
 [0.707, -0.707, 0.0]]
>>> sqlength(A)
1.999547
>>> sqlength(A, axis=(0,1))
1.999547
>>> sqlength(A, axis=0)
Array([0.999849, 0.999698])
>>> sqlength(A, axis=1)
Array([0.749849, 0.749849, 0.499849])