views:

432

answers:

1

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?

+8  A: 

Surely you jest:

asec(x) = acos(1 / x)
acsc(x) = asin(1 / x)
acot(x) = atan(1 / x)

:-P

Chris Jester-Young
+1, Pretty much: http://en.wikipedia.org/wiki/Inverse_trigonometric_functions
sixlettervariables
Yeah but it wasn't exactly obvious among the mountains of other equations - http://en.wikipedia.org/wiki/Inverse_trigonometric_functions#Logarithmic_forms
RobV