cosh . math . sncode
latest
This function computes the hyperbolic cos of a number.
COSH
NAME
cosh - This function computes the hyperbolic cos of a number.
SYNOPSIS
cosh(argument)
DESCRIPTION
This mathematical function allows the user to compute the hyperbolic cos of an argument defined between -infinity to infinity. This is not a periodic function, unlike its basis function: the cos function. It returns a value only in the 1st or the 2nd quadrant of the xy plane, meaning that if x<0, y>0, and if x>0, y>0. The cosh function is defined as cosh x = 0.5 * ( exp(x) exp(-x)), and cosh(x)=cos(ix).
PARAMETERS
- number
- Specify the number (float) used as argument for the cosh function.
RETURN
- Cosh
- The cosh value of the argument.
EXAMPLES
Note: In the followings examples, the _ between the { should be removed to make it work.
One can use this function with positive integers: test(q(res={_{cosh(1);}}.),q(res=1.54308.)); With negative integers: test(q(res={_{cosh(-1);}}.),q(res=1.54308.)); Note that cosh(-x)=cosh(x). With big integers: test(q(res={_{cosh(45);}}.),q(res=1.74671e+19.)); Note that the answer is a monstrous number. Since it is a hyperbolic function, it goes to infinity really fast until cosh(inf)=inf. With other variables: test(q(res={_{ %include "/includes/extenso.sn"; a=PI; cosh(a); }}.), q(res=11.592.)); With another trigonometric function: test(q(res={_{ %include "/includes/extenso.sn"; a=sin(0); cosh(a); }}.), q(res=1.)); With an array: test(q(res={_{cosh(1,0,-1);}}.),q(res=\[1.54308,1,1.54308\].));
AUTHOR
Written by Caroline Laplante, <claplante@sednove.com>