def magnitude(self):
if hasattr(self, '_m_magnitude'):
return self._m_magnitude if hasattr(self, '_m_magnitude') else None
self._m_magnitude, self._m_angle = cmath.polar(
complex(self.real, self.imaginary))
return self._m_magnitude if hasattr(self, '_m_magnitude') else None
评论列表
文章目录