neuroprob/utils/animal.py
def collide_wall(self, pos, wall):
        r"""
        Specifies wall with normal facing to the right when x_0 is at bottom, x_1 at top.
        Thickness is only in the direction of the normal, length is unaffected.
        """
        x_0, ang, L, vdir, ndir, thickness = wall
        pos_ = pos - x_0
        L_h = np.dot(pos_, vdir)
        L_v = np.dot(pos_, ndir)
        ang = WrapPi(np.angle(ndir[0] + 1j*ndir[1]), True)
        r = L_v - np.sign(L_v)*thickness
        
        if L_h > 0 and L_h < L and np.abs(L_v) < thickness:
            pos[0] -= r*ndir[0]
            pos[1] -= r*ndir[1]
            collide = True
        else:
            collide = False

        return collide, r, ang, pos
r"""
        Specifies wall with normal facing to the right when x_0 is at bottom, x_1 at top.
        Thickness is only in the direction of the normal, length is unaffected.
        
r"""
Specifies wall with normal facing to the right when x_0 is at bottom, x_1 at top.
Thickness is only in the direction of the normal, length is unaffected.
r " " " Specifies wall with normal facing to the right when x_0 is at bottom x_1 at top . Thickness is only in the direction of the normal length is unaffected .
def collide_wall(self, pos, wall):
        x_0, ang, L, vdir, ndir, thickness = wall
        pos_ = pos - x_0
        L_h = np.dot(pos_, vdir)
        L_v = np.dot(pos_, ndir)
        ang = WrapPi(np.angle(ndir[0] + 1j*ndir[1]), True)
        r = L_v - np.sign(L_v)*thickness
        if L_h > 0 and L_h < L and np.abs(L_v) < thickness:
            pos[0] -= r*ndir[0]
            pos[1] -= r*ndir[1]
            collide = True
        else:
            collide = False
        return collide, r, ang, pos
def collide_wall ( self , pos , wall ) : x_0 , ang , L , vdir , ndir , thickness = wall pos_ = pos - x_0 L_h = np . dot ( pos_ , vdir ) L_v = np . dot ( pos_ , ndir ) ang = WrapPi ( np . angle ( ndir [ 0 ] + 1j * ndir [ 1 ] ) , True ) r = L_v - np . sign ( L_v ) * thickness if L_h > 0 and L_h < L and np . abs ( L_v ) < thickness : pos [ 0 ] -= r * ndir [ 0 ] pos [ 1 ] -= r * ndir [ 1 ] collide = True else : collide = False return collide , r , ang , pos
r"""
Specifies wall with normal facing to the right when x_0 is at bottom, x_1 at top.
r " " " Specifies wall with normal facing to the right when x_0 is at bottom x_1 at top .
r"""
        Specifies wall with normal facing to the right when x_0 is at bottom, x_1 at top.
        Thickness is only in the direction of the normal, length is unaffected.
        """
self
pos
wall