PHP cosh()函数
PHP cosh() 是一个数学三角函数,用于返回一个数的双曲余弦值。换句话说,它将转换为双曲余弦。
语法
float cosh ( float $arg );
Parameter | Description | Required/Optional |
---|---|---|
arg | Specify a argument | Required |
示例1
<?php
n=3;
echo "Your number is:".n;
echo "<br>"."By using 'cosh()' function your value is:".cosh($n)."<br>";
?>
输出:
Your number is:3
By using 'cosh()' function your value is:10.067661995778
示例2
<?php
n=(-3);
echo "Your number is:".n;
echo "<br>"."By using 'cosh()' function your value is:".cosh($n)."<br>";
?>
输出:
Your number is:-3
By using 'cosh()' function your value is:10.067661995778
示例3
<?php
n=0;
echo "Your number is:".n;
echo "<br>"."By using 'cosh()' function your value is:".cosh($n)."<br>";
?>
输出:
Your number is:0
By using 'cosh()' function your value is:1
示例4
<?php
n=M_PI;
echo "Your number is: M_PI";
echo "<br>"."By using 'cosh()' function your value is:".cosh(n)."<br>";
?>
输出:
Your number is: M_PI
By using 'cosh()' function your value is:11.591953275522
示例5
<?php
n=2*M_PI;
echo "Your number is: 2*M_PI";
echo "<br>"."By using 'cosh()' function your value is:".cosh(n)."<br>";
?>
输出:
Your number is: 2*M_PI
By using 'cosh()' function your value is:267.74676148375