smoothing.py 文件源码

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

项目:voropy 作者: nschloe 项目源码 文件源码
def _gather_stats(mesh):
    # The cosines of the angles are the negative dot products of
    # the normalized edges adjacent to the angle.
    norms = numpy.sqrt(mesh.ei_dot_ei)
    normalized_ei_dot_ej = numpy.array([
        mesh.ei_dot_ej[0] / norms[1] / norms[2],
        mesh.ei_dot_ej[1] / norms[2] / norms[0],
        mesh.ei_dot_ej[2] / norms[0] / norms[1],
        ])
    # pylint: disable=invalid-unary-operand-type
    angles = numpy.arccos(-normalized_ei_dot_ej) / (2*numpy.pi) * 360.0

    hist, bin_edges = numpy.histogram(
        angles,
        bins=numpy.linspace(0.0, 180.0, num=19, endpoint=True)
        )
    return hist, bin_edges
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号