sinh & cosh

function sinh(x:Number):Number{
	return (Math.pow(Math.E, x) - Math.pow(Math.E, -x)) * 0.5;
}

function cosh(x:Number):Number{
	return (Math.pow(Math.E, x) + Math.pow(Math.E, -x)) * 0.5;
}

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).

Leave a Reply

Your email address will not be published. Required fields are marked *