PHP tan() 函數
定義和用法
tan() 函數返回正切。
語法
tan(x)
參數 | 描述 |
---|---|
x | 必需。一個數。 |
說明
tan() 返回參數 x 的正切值。參數 x 的單位為弧度
實例
在本例中,我們將返回不同的數的正切:
<?php echo(tan(M_PI_4)); echo(tan(0.50)); echo(tan(-0.50)); echo(tan(5)); echo(tan(10)); echo(tan(-5)); echo(tan(-10)); ?>
輸出:
1 0.546302489844 -0.546302489844 -3.38051500625 0.648360827459 3.38051500625 -0.648360827459