snake.py 文件源码

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

项目:snake 作者: rhinech 项目源码 文件源码
def normal_direction(p, p1, p2):
        """Compute normal direction at p in the segment p1->p->p2."""

        e1 = (p1 - p) / norm(p1 - p)
        e2 = Snake.rotate(e1, np.pi / 2.)
        x = np.dot(p2 - p, e1)
        y = np.dot(p2 - p, e2)
        theta = np.arctan2(y, x)
        return Snake.rotate(e1, theta / 2.)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号