示例#1
0
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 '')
示例#2
0
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 '')
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
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']))
示例#6
0
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']))
示例#7
0
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 '')
示例#8
0
def perc(x, percent):
    if percent < 0:
        return x - (x / 100) * _abs(percent)
    else:
        return x + (x / 100) * _abs(percent)
示例#9
0
def cbrt(x):
    if x < 0:
        return _abs(x)**(1/3) * -1
    else:
        return x**(1/3)
示例#10
0
def abs(x):
    return _abs(x)
示例#11
0
def abs(x):
    return _abs(x)
示例#12
0
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 '')
示例#13
0
def perc(x, percent):
    if percent < 0:
        return x - (x / 100) * _abs(percent)
    else:
        return x + (x / 100) * _abs(percent)
示例#14
0
def cbrt(x):
    if x < 0:
        return _abs(x)**(1 / 3) * -1
    else:
        return x**(1 / 3)
示例#15
0
 def abs(self):
     self._num = _abs(num)
     self._den = _abs(den)
     return self._num
     return self._den
示例#16
0
def abs(a):
    "Same as abs(a)."
    return _abs(a)
示例#17
0
def abs(a):
    "Same as abs(a)."
    return _abs(a)
示例#18
0
def abs(a):
    """Same as abs(a)."""
    return _abs(a)