sinh & cosh

Actionscript:
  1. function sinh(x:Number):Number{
  2.     return (Math.pow(Math.E, x) - Math.pow(Math.E, -x)) * 0.5;
  3. }
  4.  
  5. function cosh(x:Number):Number{
  6.     return (Math.pow(Math.E, x) + Math.pow(Math.E, -x)) * 0.5;
  7. }

Needed sinh and cosh today. Easy enough to create with existing math functions. If you needed more speed you could inline these and replace Math.E with 2.71828183.

Got the math over at wikipedia (as usual).

This entry was posted in Math, misc and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*