Exemplo n.º 1
0
 def getNode(self):
     node = notation.Number()
     if ( self.func[0:2] == "n(" ):
         node = notation.N()
     elif ( self.func[0:2] == "r(" ):
         node = notation.R()
     elif ( self.func[0:2] == "+(" ):
         node = notation.Add()
     elif ( self.func[0:2] == "*(" ):
         node = notation.Mul()
     elif ( self.func[0:2] == "-(" ):
         node = notation.Sub()
     elif ( self.func[0:2] == "/(" ):
         node = notation.Div()
     elif ( self.func[0:2] == "^(" ):
         node = notation.Pow()
     elif ( self.func[0:2] == "s(" ):
         node = notation.S()
     elif ( self.func[0:2] == "c(" ):
         node = notation.C()
     elif ( self.func[0:2] == "e(" ):
         node = notation.E()
     elif ( self.func[0:2] == "l(" ):
         node = notation.Ln()
     elif ( self.func[0:2] == "!(" ):
         node = notation.Fac()
     elif ( self.func[0:1] == "p" ):
         node = notation.P()
     elif ( self.func[0:1] == 'x' ):
         node = notation.X()
     elif( self.func[0] == ',' or self.func[0] == ')'):
         node = None
     return node
Exemplo n.º 2
0
    def getNode(self):
        node = notation.Number()
        # print(':'+self.func+':')
        if (self.func[0:2] == "n("):
            node = notation.N()
        elif (self.func[0:2] == "r("):
            node = notation.R()
        elif (self.func[0:2] == "+("):
            node = notation.Add()
        elif (self.func[0:2] == "*("):
            node = notation.Mul()
        elif (self.func[0:2] == "-("):
            node = notation.Sub()
        elif (self.func[0:2] == "/("):
            node = notation.Div()
        elif (self.func[0:2] == "^("):
            node = notation.Pow()
        elif (self.func[0:2] == "s("):
            node = notation.S()
        elif (self.func[0:2] == "c("):
            node = notation.C()
        elif (self.func[0:2] == "e("):
            node = notation.E()
        elif (self.func[0:2] == "l("):
            node = notation.Ln()
        elif (self.func[0:2] == "!("):
            node = notation.Fac()
        elif (self.func[0] == 'p'):
            node = notation.P()
        elif (self.func[0] == 'x'):
            node = notation.X()

        return node
Exemplo n.º 3
0
    def getNode(self):
        node = notation.Number()
        # print(':'+self.func+':')
        if (self.func[0:2] == "n("):
            node = notation.N()
        elif (self.func[0:2] == "r("):
            node = notation.R()
        elif (self.func[0:2] == "+("):
            node = notation.Add()
        elif (self.func[0:2] == "*("):
            node = notation.Mul()
        elif (self.func[0:2] == "-("):
            node = notation.Sub()
        elif (self.func[0:2] == "/("):
            node = notation.Div()
        elif (self.func[0:2] == "^("):
            node = notation.Pow()
        elif (self.func[0:2] == "s("):
            node = notation.S()
        elif (self.func[0:2] == "c("):
            node = notation.C()
        elif (self.func[0:2] == "e("):
            node = notation.E()
        elif (self.func[0:2] == "l("):
            node = notation.Ln()
        elif (self.func[0:2] == "!("):
            node = notation.Fac()
        elif (self.func[0:2] == "p("):
            node = notation.P()
        elif (self.func[0] == 'x'):
            node = notation.X()
        elif (self.func[0] == 'h'):
            node = notation.H()

        return node


# p = Parse("^(x,2)")
# print(p.derivative.toString())
# print(p.differenceQuotion.toString())
# # newroot.toString()