Пример #1
0
def _get_coord_systems(expr):
    g = preorder_traversal(expr)
    ret = set([])
    for i in g:
        if isinstance(i, CoordSys3D):
            ret.add(i)
            g.skip()
    return frozenset(ret)
Пример #2
0
def _get_coord_systems(expr):
    g = preorder_traversal(expr)
    ret = set([])
    for i in g:
        if isinstance(i, CoordSys3D):
            ret.add(i)
            g.skip()
    return frozenset(ret)
Пример #3
0
def symbolic_difference(ex1, ex2, thr=9):
    dif = sp.N(sympy_simplify(ex2 - ex1))
    for a in sp.preorder_traversal(dif):
        if isinstance(a, sp.Float):
            dif = dif.subs(a, round(a, thr))
    return sympy_simplify(dif)