Return the hyperbolic cosine of x.
502621
def cosh(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_cosh,
        (BigFloat._implicit_convert(x),),
        context,
    )
853758
def radians(x):
    
    if isinstance(x, UncertainFunction):
        mcpts = np.radians(x._mcpts)
        return UncertainFunction(mcpts)
    else:
        return np.radians(x)
1243474
def _cosine(a, b):
    
    return 1. * len(a & b) / (math.sqrt(len(a)) * math.sqrt(len(b)))
228541
def distance(self, x):
        """"""

        d = x - self.ctr

        return np.sqrt(np.dot(np.dot(d, self.am), d))
406501
def cosh(x):
    
    if isinstance(x, UncertainFunction):
        mcpts = np.cosh(x._mcpts)
        return UncertainFunction(mcpts)
    else:
        return np.cosh(x)
241014
def c2s(self,p=[0,0]):
        """"""

        return((p[0]-self.canvasx(self.cx1),p[1]-self.canvasy(self.cy1)))
775982
def sech(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_sech,
        (BigFloat._implicit_convert(x),),
        context,
    )
415289
def within(self, x, j=None):
        """"""

        # Loop through distance calculations if there aren't too many.
        idxs = np.where([self.ells[i].contains(x) if i != j else True
                         for i in range(self.nells)])[0]

        return idxs
212602
def xstep(self):
        
        """

        self.YU[:] = self.Y - self.U

        b = self.DSf + self.rho*sl.rfftn(self.YU, None, self.cri.axisN)
        if self.cri.Cd == 1:
            self.Xf[:] = sl.solvedbi_sm(self.Df, self.mu + self.rho,
                                        b, self.c, self.cri.axisM)
        else:
            self.Xf[:] = sl.solvemdbi_ism(self.Df, self.mu + self.rho, b,
                                          self.cri.axisM, self.cri.axisC)

        self.X = sl.irfftn(self.Xf, self.cri.Nv, self.cri.axisN)

        if self.opt['LinSolveCheck']:
            Dop = lambda x: sl.inner(self.Df, x, axis=self.cri.axisM)
            if self.cri.Cd == 1:
                DHop = lambda x: np.conj(self.Df) * x
            else:
                DHop = lambda x: sl.inner(np.conj(self.Df), x,
                                          axis=self.cri.axisC)
            ax = DHop(Dop(self.Xf)) + (self.mu + self.rho)*self.Xf
            self.xrrs = sl.rrs(ax, b)
        else:
            self.xrrs = None
1161757
def rec_sqrt(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_rec_sqrt,
        (BigFloat._implicit_convert(x),),
        context,
    )
1086140
def cnst_A(self, X, Xf=None):
        
        """

        return np.concatenate((self.cnst_A0(X, Xf),
                               self.cnst_A1(X)), axis=-1)
352964
def r(w, Xs):
    '''
    '''
    n = len(Xs)
    P = projection_matrix(w)
    c = C(w, Xs)

    return np.sqrt(sum(np.dot(c - X, np.dot(P, c - X)) for X in Xs) / n)
1325310
def sbessely(x, N):
    

    out = np.zeros(N, dtype=np.float64)

    out[0] = -np.cos(x) / x
    out[1] = -np.cos(x) / (x ** 2) - np.sin(x) / x

    for n in xrange(2, N):
        out[n] = ((2.0 * n - 1.0) / x) * out[n - 1] - out[n - 2]

    return out
973606
def _get_coord(self, coord):
        
        x, y = coord
        return self.ctypes.c_int(y << 16 | x)
951874
def xAxisIsMajor(self):
        '''
        
        '''
        return max(self.radius.x, self.radius.y) == self.radius.x
219133
def cnst_AT(self, X):
        
        """

        return np.sum(self.cnst_A0T(X), axis=-1) + self.cnst_A1T(X)
227743
def _get_x_axis(self):
        """"""
        # 0,0 is top/left top top/left pixel. Actual x/y coord of that pixel are (.5,.5).
        x_centers = np.linspace(.5, self.x_size - .5, self.x_size)
        y_centers = x_centers * 0
        return (self.geotransform[0]
                + self.geotransform[1] * x_centers
                + self.geotransform[2] * y_centers)