定義和用法
這個sinh()函數以弧度計算給定角度的雙曲正弦值。雙曲正弦函數定義為
sinh(x) =(ex - e-x))/2
此函數返回一個介於 Π 和 -Π 之間的浮點值。
用法
sinh( float $arg ):float
參數
Sr.No | 參數及說明 |
---|---|
1 | arg 以弧度表示角度的浮點值 |
返回值
PHP sinh() 函數返回給定參數的雙曲正弦比。
PHP版本
該函數在 PHP 4.x、PHP 5.x 和 PHP 7.x 版本中可用。
示例
以下示例計算 sinh(pi/2) 並返回 2.3012989023073,這也是公式 (ex-e-x))/2−
<?php
$arg=M_PI_2;
$val=(exp($arg)-exp(-$arg))/2;
$res=sinh($arg);
echo "sinh(M_PI_2) = " . $val. "\n";
echo "using formula = " . $res . "\n";
?>
輸出
這將產生以下結果 -
sinh(M_PI_2) = 2.3012989023073 using formula = 2.3012989023073
示例
以下示例使用 deg2rad() 函數將度數轉換為弧度,然後使用 sinh(30) -
<?php
$arg=deg2rad(30);
$val=sinh($arg);
echo "sinh(" . $arg . ") = " . $val;
?>
輸出
這將產生以下結果 -
sinh(0.5235987755983) = 0.54785347388804
示例
讓我們檢查一下 sinh(0)。它返回 0 -
<?php
$arg=0;
$val=sinh($arg);
echo "sinh(" . $arg . ") = " . $val;
?>
輸出
這將產生以下結果 -
sinh(0) = 0
示例
以下示例計算 sinh(pi)
<?php
$arg=M_PI; // pi
$val=sinh($arg);
echo "sinh(" . $arg . ") = " . $val;
?>
輸出
這將產生以下結果 -
sinh(3.1415926535898) = 11.548739357258
相關用法
- PHP sinh()用法及代碼示例
- PHP sinh( )用法及代碼示例
- PHP sin( )用法及代碼示例
- PHP sin()用法及代碼示例
- PHP simplexml_load_file()用法及代碼示例
- PHP simplexml_load_string()用法及代碼示例
- PHP simplexml_import_dom()用法及代碼示例
- PHP sizeof()用法及代碼示例
- PHP similar_text()用法及代碼示例
- PHP string rtrim()用法及代碼示例
- PHP strsrt()用法及代碼示例
- PHP sqrt()用法及代碼示例
- PHP stats_dens_pmf_binomial()用法及代碼示例
- PHP string printf()用法及代碼示例
- PHP string ord()用法及代碼示例
- PHP string join()用法及代碼示例
- PHP Spreadsheet_Excel_Writer setAlign()用法及代碼示例
- PHP strtolower()用法及代碼示例
- PHP Spreadsheet_Excel_Writer setScript()用法及代碼示例
- PHP str_split()用法及代碼示例
注:本文由純淨天空篩選整理自Malhar Lathkar大神的英文原創作品 PHP sinh() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。