import_witherden_vincent.py 文件源码

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

项目:quadpy 作者: nschloe 项目源码 文件源码
def read_data_tri(filename):
    data = numpy.loadtxt(filename)
    if len(data.shape) == 1:
        data = numpy.array([data])
    points = data[:, :2]
    weights = data[:, 2]
    # The reference triangle is (-1, -1), (1, -1), (-1, 1). Transform the
    # points to barycentric coordinates.
    points += 1.0
    points *= 0.5
    points = numpy.array([
        points[:, 0],
        points[:, 1],
        1.0 - numpy.sum(points, axis=1)
        ]).T
    return points, weights * 0.5
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号