I'm trying to implement inverse trigonometric functions in a C# application. Obviously I'm not talking about simple inverse sin, cos and tan seeing as those are all provided by the Math class. What I'm looking for is the inverses for sec, cosec and cotan:
Func<double,double> secant = (d => (1 / Math.Cos(d)));
Func<double,double> cosecant = (d => (1 / Math.Sin(d)));
Func<double,double> cotangent = (d => (Math.Cos(d) / Math.Sin(d)));
Now my problem is that I want to implement the inverses of each of these but I can't seem to find a simple definition of the appropriate inverses - arcsec, arccsc and arccot - which I can turn into C# code.
So my question is can you either (a) point me in the direction of a good resource or (b) show me some example code for this?
C acos() The acos() function returns the arc cosine (inverse cosine) of a number in radians. The acos() function takes a single argument (1 ≥ x ≥ -1), and returns the arc cosine in radians. Mathematically, acos(x) = cos-1(x) .
The asin() function returns the arc sine (inverse sine) of a number in radians. The asin() function takes a single argument (1 ≥ x ≥ -1), and returns the arc sine in radians. Mathematically, asin(x) = sin-1(x) .
Surely you jest:
asec(x) = acos(1 / x)
acsc(x) = asin(1 / x)
acot(x) = atan(1 / x)
:-P
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With