pymel.util.normal

normal(a, axis=None)

normal(a[, axis=(axis0, axis1, ...)]) –> Array

Returns a normalized copy of self: self/length(self, 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]]
>>> print normal(A).formated()
[[0.353593437318, 0.353593437318, -0.499981120367],
 [0.499981120367, -0.499981120367, 0.0]]
>>> print normal(A, axis=(0,1)).formated()
[[0.353593437318, 0.353593437318, -0.499981120367],
 [0.499981120367, -0.499981120367, 0.0]]
>>> print normal(A, axis=0).formated()
[[0.5, 0.5, -0.707],
 [0.707, -0.707, 0.0]]
>>> print normal(A, axis=1).formated()
[[0.577408397894, 0.577408397894, -1.0],
 [0.816455474623, -0.816455474623, 0.0]]

Previous topic

pymel.util.namedtuple

Next topic

pymel.util.outer

Core

Core Modules

Other Modules

This Page