php tan() 函数
定义tan()函数计算指定弧度的正切值。 语法PHP tan()函数具有以下语法。 float tan ( float num ) 参数参数 描述 num 需要。指定以弧度表示的值 该参数应以弧度形式传递。我们应该使用deg2rad()将度转换为弧度。 返回值项目 值 返回值 弧度的正切 返回类型 浮点型 实例返回不同数字的正切 /* http://www.manongjc.com/article/1748.html 作者:脚本之家教程 */ $tan1 = tan(10); print($tan1); print "n"; $tan2 = tan(deg2rad(80)); print($tan2); print "n"; echo(tan(M_PI_4) . "n"); echo(tan(0.50) . "n"); echo(tan(-0.50) . "n"); echo(tan(5) . "n"); echo(tan(1) . "n"); echo(tan(-5) . "n"); echo(tan(-1)); ?> 上面的代码生成以下结果: 0.64836082745909 5.6712818196177 1 0.54630248984379 -0.54630248984379 -3.3805150062466 1.5574077246549 3.3805150062466 -1.5574077246549 (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
