### COS

Returns the cosine of an angle

**Syntax:**

**Usage:**

`
`

*result*=

**Cos**(

*angle*)

**Parameters:**

*angle*
the angle (in radians)

**Return Value:**

**Description:**

The argument

The value returned by this function is undefined for values of

`is measured in radians (not degrees).`*number*The value returned by this function is undefined for values of

`with an absolute value of`*angle*`2 ^ 63`or greater.`can be overloaded as operator to accept user-defined types.`**Cos****Examples:**

Const PI As Double = 3.1415926535897932

Dim a As Double

Dim r As Double

Input "Please enter an angle in degrees: ", a

r = a * PI / 180 'Convert the degrees to Radians

Print ""

Print "The cosine of a" ; a; " degree angle is"; Cos ( r )

Sleep

Dim a As Double

Dim r As Double

Input "Please enter an angle in degrees: ", a

r = a * PI / 180 'Convert the degrees to Radians

Print ""

Print "The cosine of a" ; a; " degree angle is"; Cos ( r )

Sleep

Output:

Please enter an angle in degrees: 30 The cosine of a 30 degree angle Is 0.8660254037844387

**Differences from QB:**

- None

**See also:**

Back to Math