#973 Inverse Hyperbolic Trig Funcs

tactics Thu 11 Feb 2010

I'm playing with relativity simulation tonight. I just noticed Float has sinh and friends, but not their inverses. Eventually, we'll want them for completeness.

helium Thu 11 Feb 2010

edit: deleted

brian Thu 11 Feb 2010

What functions exactly are you looking for? I think I exposed just about everything available on java.lang.Math.

tactics Thu 11 Feb 2010

Peculiar. It looks like I made the assumption Java had such a function in their math lib.

Basically, what I was looking for was asinh, acosh, and atanh that are supported by the C99 standard's math.h.

But if Java doesn't have support for those functions, I'll find another way to do what I'm trying to do.

KevinKelley Thu 11 Feb 2010

From http://math2.org/math/trig/hyperbolics.htm:

arcsinh(z) = ln( z + sqrt(z^2 + 1) )
arccosh(z) = ln( z +/- sqrt(z^2 - 1) )
arctanh(z) = 1/2 * ln( (1+z)/(1-z) )
arccsch(z) = ln( (1 + sqrt(1+z^2) )/z )
arcsech(z) = ln( (1 +/- sqrt(1-z^2) )/z )
arccoth(z) = 1/2 * ln( (z+1)/(z-1) )

If I read right, asinh is valid for all reals, acosh for non-negative only; some of the others appear to make more sense on complex than on real.

tactics Thu 11 Feb 2010

Yeah. I saw those definitions :)

KevinKelley Thu 11 Feb 2010

Cool, figured. Posted anyway, just in case somebody wanted to talk about whether to add them (or the first three anyway) to Float. Did you happen across any implementation details from some C99 impl, or is typical implementation just as above?

tactics Thu 11 Feb 2010

No. I was just shocked that Java doesn't have them. I know that Java inherits it's math library based on the C library, so I checked it on Wikipedia (linked above), and apparently, they were added in the C99 revision to the standard. With that being the case, it makes sense why Java wouldn't have them.

Login or Signup to reply.