Scaling such that norm equals 1
(self)
| 4350 | return self.scalar*self.scalar + np.dot(self.vector, self.vector) |
| 4351 | |
| 4352 | def normalize(self): |
| 4353 | """Scaling such that norm equals 1""" |
| 4354 | n = np.sqrt(self.norm) |
| 4355 | return self.__class__(self.scalar/n, self.vector/n) |
| 4356 | |
| 4357 | def reciprocal(self): |
| 4358 | """The reciprocal, 1/q = q'/(q*q') = q' / norm(q)""" |