Perl atan2 函式



說明

此函式返回 -PI 到 PI 範圍內的 Y/X 的反正切。

語法

下面是此函式的簡單語法 -

atan2 Y,X

返回值

此函式返回 -PI 到 PI 範圍內的 Y/X 的反正切。

示例

以下是展示基本用法的示例程式碼 -

#!/usr/bin/perl

$Y = 30;
$X = 60;

$ret_val = atan2 ($Y, $X );

print "atan2 of 30/60 is : $ret_val\n";

執行上述程式碼時,會產生以下結果 -

atan2 of 30/60 is : 0.463647609000806
perl_function_references.htm
廣告
© . All rights reserved.