CitectVBA Programming Reference > CitectVBA Function Reference > Math/Trigonometry Functions > Cos

Cos

Calculates the trigonometric Cosine value of an angle.

The Cos function expects the argument (Rad) to be a valid angle value in radians, and calculates the ratio of the two sides of a right-angle triangle on either side of the angle. The ratio is the length of the side adjacent to the angle divided by the length of the hypotenuse.

Note: To convert degrees to radians, multiply degrees by Pi/180. To convert radians to degrees, multiply radians by 180/Pi.

Syntax

Cos(Rad)

Rad:

An angle expressed in radians. It must be a valid numeric value.

Return Value

Returns the Cosine value of the angle (Rad) provided in the argument.
The result lies in the range - 1 to +1.

Cos will return a double.

Related Functions

Atn | Sin | Tan

Example

Variable=Cos(0.7854); ! Sets Variable to 0.7071...