HOW TO FIX PI
09-19-2016, 11:56 PM
Let's say that for some reason, you are in a chat with a robot which has redefined all of math. For instance,
- pi = "fucking"
- e = 3
- sin = infinity
- cos = [3, 4.33, "meowing"]
- exp = ["e", "x", "p"]
- infinity = 2
- NaN = 10
- false = true
- OR JUST ANYTHING = "all star"
- pi=4*(.5!)^2
- sqrt(x)=x^.5
- i=sqrt(-1)
- (OPTIONAL, if re isn't screwed up.) i=i-re(i)
- e=(i^i)^(-2/pi)
- exp(x)=e^x
- sin(x)=(exp(i*x)-exp(-i*x))/(2*i), cos(x)=.5*(exp(i*x)+exp(-i*x))
- tan(x)=sin(x)/cos(x), cot(x)=cos(x)/sin(x), sec(x)=1/cos(x), csc(x)=1/sin(x)
- Assuming you have atan2 and it isn't screwed up (or you have arg, which is the same), you can fix all inverse trig
- atan(x)=atan2(x,1) OR atan(x)=arg(1+x*i)
- asin(x)=atan(x/sqrt(1-x^2)), acos(x)=atan(sqrt(1-x^2)/x)
- acot(x)=atan(1/x), asec(x)=acos(1/x), acsc(x)=asin(1/x)
- If you have any inverse hyperbolic function or the natural logarithm, you can get all these functions back too:
- asinh(x)=acosh(sqrt(x^2+1)), acosh(x)=asinh(sqrt(x^2-1))
- atanh(x)=asinh(x/sqrt(1-x^2)) OR acosh(1/sqrt(1-x^2))
- asinh(x)=atanh(x/sqrt(1+x^2)), acosh(x)=atanh(sqrt(x^2-1)/x)
- log(x)=asinh((x^2-1)/(2*x)) OR acosh((x^2+1)/(2*x)) OR atanh((x^2-1)/(x^2+1))
- atanh(x)=.5*log((1+x)/(1-x)), acosh(x)=.5*log((x+1)/(x-1))