Cos

首页  后退  前进

 


Cos
down2

Cos

计算数的余弦值.

 

Cos ( expression )

参数

expression

弧度值.

返回值

返回数的三角余弦值.

备注

弧度 1° = pi(圆周率) / 180.

 

函数示例

#include <MsgBoxConstants.au3>
Example()
Func Example()
    ; Assign a Local constant variable the approximate PI number.
    Local Const $PI = 3.141592653589793
    ; Assign a Local variable the cosine of PI / 4 (equals to Sqrt(2) / 2).
    Local $fCos1 = Cos($PI / 4)
    ; Display the result.
    MsgBox($MB_SYSTEMMODAL, "", $fCos1)
    ; Assign a Local variable the formula to switch from radian to degree (equals to one degree in radian).
    Local $fDegToRad = $PI / 180
    ; Assign a Local variable the cosine of 90 degrees (firstly converted to radians).
    Local $fCos2 = Cos(90 * $fDegToRad)
    ; Display the result.
    MsgBox($MB_SYSTEMMODAL, "", $fCos2)
EndFunc   ;==>Example

----------------------------------------

该函数可以通过命令 exect 调用

参见:

ACos, Sin, Tan, ASin, ATan

例子
copy
Cos(3.14159265358979/4) ;; 45度余弦

 

exect=$var_pi=3.14159265358979||$var_nd=$var_pi/180||$var_nr=180/$var_pi||$var_na=Cos($var_pi/4)||$var_nb=Cos(90*$var_nd)||Cos(30/$var_nr) GLOBALEXECT<a> ;; 各种计算使用余弦函数的角度

up2

tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru