scaffold.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ababe 作者: unkcpz 项目源码 文件源码
def in_euclidean_discance(self, pos, center, r):
        """
            A helper function to return true or false.
            Decided whether a position(frac) inside a
            distance restriction.
        """
        from scipy.spatial.distance import euclidean as euclidean_discance
        from itertools import product

        cart_cent = self.get_cartesian_from_frac(center)
        trans = np.array([i for i in product([-1, 0, 1], repeat=3)])
        allpos = pos + trans
        for p in allpos:
            cart_p = self.get_cartesian_from_frac(p)
            if euclidean_discance(cart_p, cart_cent) < r:
                return True
                break

        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号