modified: research/activity24-math-plot.yaml
This commit is contained in:
parent
c7086f6ee9
commit
3e183da802
1 changed files with 5 additions and 2 deletions
|
|
@ -54,9 +54,12 @@ sections:
|
|||
user_function = re.sub(r'(?<=[a-zA-Z])(?=\d)', '*', user_function)
|
||||
|
||||
# Replace common math functions with their math module equivalents
|
||||
math_functions = ['sin', 'cos', 'tan', 'exp', 'log', 'sqrt', 'abs']
|
||||
math_functions = [
|
||||
'sin', 'cos', 'tan', 'exp', 'log', 'sqrt', 'abs', 'pi', 'e', 'inf',
|
||||
'sinh', 'cosh', 'tanh', 'arctan',
|
||||
]
|
||||
for func in math_functions:
|
||||
user_function = user_function.replace(func, f'numpy.{func}')
|
||||
user_function = re.sub(r'\b' + func + r'\b', f'numpy.{func}', user_function)
|
||||
|
||||
# Prepare the x values
|
||||
x = numpy.linspace(-10, 10, 400)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue