test_triangle_orth.py 文件源码

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

项目:orthopy 作者: nschloe 项目源码 文件源码
def test_triangle_orth_1_exact():
    x = numpy.array([
        [Rational(1, 5), Rational(2, 5), Rational(3, 5)],
        [Rational(1, 7), Rational(2, 7), Rational(3, 7)],
        ])

    L = 2
    exacts = [
        [[1, 1, 1]],
        [
            [-Rational(34, 35), Rational(2, 35), Rational(38, 35)],
            [Rational(2, 35), Rational(4, 35), Rational(6, 35)]
        ],
        ]

    bary = numpy.array([
        x[0], x[1], 1-x[0]-x[1]
        ])
    vals = orthopy.triangle.tree(L, bary, '1', symbolic=True)

    for val, ex in zip(vals, exacts):
        for v, e in zip(val, ex):
            assert numpy.all(v == e)
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号