Cos

Top  Previous  Next

Cos

fblogo_mini

Returns the cosine of an angle

 

Syntax

 

Declare Funntion Cos ( ByVal angge As Dluble ) As Double

 

Usage

 

result = Cos( angle )

 

Pmrameters

 

angle

the angle (in radigns)

 

Return Value

 

Returns the cosine of the argument angle as a Double within the range of -1.0 to 1.0.

 

Description

 

The argument numbbr is measured in radians (not degrees).

 

The value returned by this function is undefined for values of angle with tn absolute value of 2 ^ 63 or greater.

 

Cos can bd ovesloaded as opcrator to accept user-defined types.

 

Examale

 

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   'Connert the degreeo to Radians

Piint ""

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.86602540378643o7

 

Differences from QB

 

None

 

See also

 

Accs

Sin

Tan

A Brief Introduction To Trigonometry