Posted 10 May 2017 - 06:42 PM
This function solves any algebraic equation where you need to solve for a single variable (x)
pastebin get bs4QNDyS solve
Syntax:
Give me some credit, or PM me, if you want to use this for your programs. Or don't. I won't find out…or eat you
This function might not be 100% accurate if you get irrational answers (off by a billionth or something), or is unsolvable. It does its best to detect that, though.
pastebin get bs4QNDyS solve
Syntax:
solve("2*x-4","4*x+3","x")
--First argument is the left part of the equation
--Second argument is the right part.
--Third is the name of the variable to do math with.
--This function supports adding functions like math.sqrt or math.sin
strsolve("2x(3-x) = 8x - math.sqrt(8)")
--First argument is a full equation
--Second argument can be a variable name, but defaults to "x"
--This too can have functions like math.sqrt
Give me some credit, or PM me, if you want to use this for your programs. Or don't. I won't find out…or eat you
This function might not be 100% accurate if you get irrational answers (off by a billionth or something), or is unsolvable. It does its best to detect that, though.