This question has already been answered:
for example, there is the string sin (x ^ 2) how to convert it to Math.sin (pow (x, 2))
This question has already been answered:
for example, there is the string sin (x ^ 2) how to convert it to Math.sin (pow (x, 2))
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
There is a mathjs library
You can execute expressions in it:
math.eval('sqrt(3^2 + 4^2)') // 5 math.eval('sqrt(-4)') // 2i math.eval('2 inch to cm') // 5.08 cm math.eval('cos(45 deg)') // 0.7071067811865476 Source: https://ru.stackoverflow.com/questions/870290/
All Articles