def test_triangle_orth_exact():
x = numpy.array([Rational(1, 3), Rational(1, 7)])
L = 2
exacts = [
[sympy.sqrt(2)],
[-Rational(8, 7), 8*sympy.sqrt(3)/21],
[-197*sympy.sqrt(6)/441,
-136*sympy.sqrt(2)/147,
-26*sympy.sqrt(30)/441],
]
bary = numpy.array([
x[0], x[1], 1-x[0]-x[1]
])
vals = orthopy.triangle.tree(L, bary, 'normal', symbolic=True)
for val, ex in zip(vals, exacts):
for v, e in zip(val, ex):
assert v == e
return
评论列表
文章目录