PHP atan() 函數用於解決三角函數問題。它將 arg 的反正切作為 Pi/2 和 pi/2 弧度之間的數值返回。
用法:
atan(arg);
參數 | 描述 | 必需/可選 |
---|---|---|
arg | 指定要處理的參數。 | Required |
例子1
<?php
$num=(0.5);
echo "Passing number is:".$num;
echo "<br>"."By using 'atan()' function your number is:".(atan($num));
?>
輸出:
Passing number is:0.5 By using 'atan()' function your number is:0.46364760900081
例子2
<?php
$num=(-0.50);
echo "Passing number is:".$num;
echo "<br>"."By using 'atan()' function your number is:".(atan($num));
?>
輸出:
Passing number is:-0.5 By using 'atan()' function your number is:-0.46364760900081
例子3
<?php
$num=5;
echo "Your passing number is:".$num;
echo "<br>"."By using 'atan()' function your number is:".(atan($num));
?>
輸出:
Your passing number is:5 By using 'atan()' function your number is:1.373400766945
示例 4
<?php
$num=(-5);
echo "Your passing number is:".$num;
echo "<br>"."By using 'atan()' function your number is:".(atan($num));
?>
輸出:
Your passing number is:-5 By using 'atan()' function your number is:-1.373400766945
例 5
<?php
$num=200;
echo "Your passing number is:".$num;
echo "<br>"."By using 'atan()' function your number is:".(atan($num));
?>
輸出:
Your passing number is:200 By using 'atan()' function your number is:1.5657963684609
例 6
<?php
$num=-200;
echo "Your passing number is:".$num;
echo "<br>"."By using 'atan()' function your number is:".(atan($num));
?>
輸出:
Your passing number is:-200 By using 'atan()' function your number is:-1.5657963684609
例 7
<?php
$num=(3*pi()/2);
echo "passing number (3*pi()/2) is:".$num;
echo "<br>"."By using 'atan()' function your number is:".(atan($num));
?>
輸出:
passing number (3*pi()/2) is:4.7123889803847 By using 'atan()' function your number is:1.3616916829712
相關用法
- PHP atan( )用法及代碼示例
- PHP atan2()用法及代碼示例
- PHP atanh()用法及代碼示例
- PHP atan2( )用法及代碼示例
- PHP atanh( )用法及代碼示例
- PHP PHPUnit assertIsNotFloat()用法及代碼示例
- PHP array_reverse()用法及代碼示例
- PHP PHPUnit assertStringStartsWith()用法及代碼示例
- PHP PHPUnit assertIsObject()用法及代碼示例
- PHP PHPUnit assertNotIsReadable()用法及代碼示例
- PHP array_filter()用法及代碼示例
- PHP PHPUnit assertNotNull()用法及代碼示例
- PHP array_pop()用法及代碼示例
- PHP PHPUnit assertEqualsIgnoringCase()用法及代碼示例
- PHP asort()用法及代碼示例
- PHP array_diff_uassoc()用法及代碼示例
- PHP PHPUnit assertIsNotScalar()用法及代碼示例
- PHP array_intersect_key()用法及代碼示例
- PHP array_key_first()用法及代碼示例
- PHP PHPUnit assertDirectoryNotIsWritable()用法及代碼示例
注:本文由純淨天空篩選整理自 PHP atan() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。