def m_ftin(m): _foot = int(_abs(m_ft(m))) _inch = _round(ft_in(_abs(m_ft(m)) - _foot), 2) if _inch == int(_inch): _inch = int(_inch) return '{s}ftin_m({0}, {1})'.format(_foot, _inch, s='-' if m < 0 else '')
def dd(degrees): _deg = int(_abs(degrees)) _min = int((_abs(degrees) - _deg) * 60) _sec = _round((_abs(degrees) - _deg - _min / 60) * 3600) return '{s}dms({0}, {1}, {2})'.format(_deg, _min, _sec, s='-' if degrees < 0 else '')
def _f_Laguerre_Gauss_spherical(self, sin_theta, theta, phi, W_y, k, m): """Laguerre-Gaussian spectrum amplitude. Implementation for spherical coordinates. """ return self._f_Gauss_spherical(sin_theta, W_y, k) * theta**_abs(m) * \ _cexp(1j*m*phi)
def _f_Laguerre_Gauss_cartesian(self, k_y, k_z, W_y, k, m): """Laguerre-Gaussian spectrum amplitude. Impementation for Cartesian coordinates. """ return self._f_Gauss_cartesian(k_y, k_z, W_y) * \ _cexp(1j*m*self._phi(k_y, k_z)) * self._theta(k_y, k_z, k)**_abs(m)
def rt(x, N): if _is_pointZero(N) and N >= 2: if x < 0: if N % 2: return _abs(x)**(1/N) * -1 else: raise MathError(translate('MathErrors', _errors['mde'])) else: return x**(1/N) else: raise MathError(translate('MathErrors', _errors['mde']))
def rt(x, N): if _is_pointZero(N) and N >= 2: if x < 0: if N % 2: return _abs(x)**(1 / N) * -1 else: raise MathError(translate('MathErrors', _errors['mde'])) else: return x**(1 / N) else: raise MathError(translate('MathErrors', _errors['mde']))
def dd(degrees): _deg = int(_abs(degrees)) _min = int((_abs(degrees) - _deg) * 60) _sec = _round((_abs(degrees) - _deg - _min/60) * 3600) return '{s}dms({0}, {1}, {2})'.format(_deg, _min, _sec, s='-' if degrees < 0 else '')
def perc(x, percent): if percent < 0: return x - (x / 100) * _abs(percent) else: return x + (x / 100) * _abs(percent)
def cbrt(x): if x < 0: return _abs(x)**(1/3) * -1 else: return x**(1/3)
def abs(x): return _abs(x)
def cbrt(x): if x < 0: return _abs(x)**(1 / 3) * -1 else: return x**(1 / 3)
def abs(self): self._num = _abs(num) self._den = _abs(den) return self._num return self._den
def abs(a): "Same as abs(a)." return _abs(a)
def abs(a): """Same as abs(a).""" return _abs(a)