PHP tan() 函数


PHP tan() 函数

定义和用法

tan() 函数返回正切。

语法

tan(x)
参数 描述
x 必需。一个数。

说明

tan() 返回参数 x 的正切值。参数 x 的单位为弧度

实例

在本例中,我们将返回不同的数的正切:

<?phpecho(tan(M_PI_4));echo(tan(0.50));echo(tan(-0.50));echo(tan(5));echo(tan(10));echo(tan(-5));echo(tan(-10));?>

输出:

10.546302489844-0.546302489844-3.380515006250.6483608274593.38051500625-0.648360827459
标签:, , ,