Scripting > UNICOM Intelligence Function Library > Mathematical functions > Cos
 
Cos
Returns the cosine of an angle.
Syntax
Cos(Val)
Parameters
Val
Type: Double
A numeric value that represents an angle in radians.
(return)
Type: Double
Cosine of Val.
Remarks
The Cos function takes an angle in a right-angled triangle and returns a value that corresponds to the length of the side adjacent to the angle divided by the length of the hypotenuse.
If the current data value is NULL, Val is 0.0 and the return value is 1.0.
This function is similar to the Cos function in VBScript.
Example
The following mrScriptBasic example uses the Cos function to get the cosine of an angle:
Dim MyCosine
MyCosine = Cos(2.7) ' Returns -0.904072142017061
See also
Sin
Mathematical functions