Returns the cosine of an angle.
numberThe parameter can be any valid numeric expression that represents an angle as radians.
CosThe function takes an angle and returns the ratio of both sides of a right triangle. This ratio is the ratio of the length of the adjacent edge to the length of the hypotenuse of the angle in a right triangle. The results range from – 1 to 1.
The angle is converted into radians by multiplying the angle by pi / 180. Conversely, the way to convert radians into angles is to multiply radians by 180 / PI.
The following example usesCosFunction returns the cosine of an angle:
Dim myangle, mysecantmyangle = 1.3 'define an angle in radians. Mysecant = 1 / cos (myangle) 'calculates secant.