How to convert an equation into formulas for individual variables? I am thinking about a math equations like:
c^2 = a^2 + b^2
I would like to have a function that could process any formula, and give me the individual variable formulas. The above equation would produce the following:
a = (c^2 - b^2)^0.5
b = (c^2 - a^2)^0.5
c = (a^2 + b^2)^0.5
I would also like to start with:
a = (c^2 - b^2)^0.5
and output:
b = (c^2 - a^2)^0.5
c = (a^2 + b^2)^0.5
I have looked at expression trees, but I am having trouble visualizing how this will work. I would like a .NET (C#, VB.NET, or F#) solution. Any ideas?
Something like:
public string[] GetFormulas(string equation)
{
...
}
Thanks.