MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / normalize

Method normalize

python/pymesh/misc/quaternion.py:84–92  ·  view source on GitHub ↗

Normalize quaterion to have length 1.

(self)

Source from the content-addressed store, hash-verified

82 return n
83
84 def normalize(self):
85 """ Normalize quaterion to have length 1.
86 """
87 n = self.norm()
88 if n == 0:
89 print(self.__quat)
90 raise ZeroDivisionError("quaternion cannot be 0!")
91
92 self.__quat /= n
93
94 def __str__(self):
95 return str(self.__quat)

Callers 9

__init__Method · 0.95
PeriodicMaterialMethod · 0.80
edgeConeTestMethod · 0.80
faceConeTestMethod · 0.80
earclipMethod · 0.80
compute_quad_normalMethod · 0.80

Calls 1

normMethod · 0.95

Tested by

no test coverage detected