Add files via upload

This commit is contained in:
Silviu Marian Udrescu 2020-04-25 21:18:20 -04:00 committed by GitHub
parent d718358ff5
commit e7c14517c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ import numpy as np
def RPN_to_eq(expr):
variables = ["0","1","a","b","c","d","e","f","g","h","i","j","k","l","m","n","P"]
operations_1 = [">","<","~","\\","L","E","S","C","A","N","T","R"]
operations_1 = [">","<","~","\\","L","E","S","C","A","N","T","R","O","J"]
operations_2 = ["+","*","-","/"]
stack = np.array([])
@ -66,4 +66,10 @@ def RPN_to_eq(expr):
if i=="R":
a="sqrt("+a+")"
stack = np.append(stack,a)
return(stack[0])
if i=="O":
a="(2*("+a+"))"
stack = np.append(stack,a)
if i=="J":
a="(2*("+a+")+1)"
stack = np.append(stack,a)
return(stack[0])