The meaning of the algorithm is that it expresses from any formula any value (no matter what). For example, the formula S = v * t and you need to express from it for example t so that it is t = S / v. but the formula can be complex. Is there any algorithm for such cases?
1 answer
An example of the implementation of such an algorithm contains the sympy library ( Python ):
from sympy import solve, sympify, Symbol # решаем уравнение x * a = b относительно переменной x # уравнение можно переписать в виде x * a - b = 0 equation = sympify('x * a - b') x = Symbol('x') solution = solve(equation, x) print(solution) # выведет [ b/a ] Some links:
- Similar question to math.stackexchange.com
- Similar question to cs.stackexchange.com
- Similar question on stackoverflow.com
- A related question about
sympy sympy- Online service WolframAlpha , able to solve such and many other equations
- Is there no such method in java? - DAVID
- oneI don’t have a built-in @DAVID, but I’m sure that there is a library for Java that allows you to do something similar - diraria
|