专注各种脚本编程
Baidu
加入收藏夹
本站内容有下面分类知识,欢迎您的到来^_^
shell相关:指令篇 基础篇 脚本欣赏 编程实例 shell问问 shell视频教程 技巧篇 水平测试 E文资料 vi编辑器 高级Bash脚本编程指南
其他:mysql perl c语言 oracle
当前位置:| 主页>perl>

perl数学函数sin/cos/atan2/sqrt

百度收藏 QQ搜藏
函数名 sin
调用语法 retval = sin (value);
解说 参数为弧度值。

函数名 cos
调用语法 retval = cos (value);
解说 参数为弧度值。

函数名 atan2
调用语法 retval = atan2 (value1, value2);
解说 运算并返回value1除以value2结果的arctan值,单位为弧度,范围在-PI~PI。
应用例:
角度转化成弧度子程序。
sub degrees_to_radians {
  local ($degrees) = @_;
  local ($radians);11:
  $radians = atan2(1,1) * $degrees / 45;
}

函数名 sqrt
调用语法 retval = sqrt (value);
解说 平方根函数。value为非负数。
上一篇:perl其它控制函数caller/chroot/local/times 下一篇:perl数学函数exp/log/abs/rand/srand

power by soyo123 2007-2008