MyChat Scripts Engine: Cos
Computing the cosine value of the specified number in radians.
Syntax
function Cos(x: extended): extended;
Parameters and return values
Parameter |
Type |
Value |
x |
extended |
number from which you need to compute the cosine. |
Function result
Cosine of the number in radians. Pi radian equals to 180 degrees.
Example
const
alpha = 30; // 30 degrees
var
x: extended;
begin
x := sin(alpha) * sin(alpha) + cos(alpha) * cos(alpha);
mLogScript(inttostr(trunc(x)), ''); // must be equal to 1
end.
Script work result
[08:13:20] (Log "Cos"): 1