Cos Function

Returns the cosine of a numeric expression.

Syntax
Cos (number)

Parameters

number
Specify the angle as a number (radian).

Return Values
Numeric value in radians representing the cosine of the numeric expression number.

Description
Cos returns the cosine of the numeric expression. The numeric expression (number) must be in radian units. The value returned by the Cos function will range from -1 to 1

To convert from degrees to radians, use the DegToRad function.

See Also
Abs, Atan, Atan2, Int, Mod, Not, Sgn, Sin, Sqr, Str$, Tan, Val

Cos Function Example
The following example shows a simple program which uses Cos.

Function costest
  Real x
  Print "Please enter a value in radians"
  Input x
  Print "COS of ", x, " is ", Cos(x)
Fend

The following examples use Cos from the Command window.

Display the cosine of 0.55:

>print cos(0.55)
 0.852524522059506
>

Display cosine of 30 degrees:

>print cos(DegToRad(30))
 0.866025403784439
>