COS()

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

This function returns the cosine of the given angle or expression.
The angle must be expressed in radians.
The opposite is the ACS() function.

Syntax

  1. COS(Number)

Hints

Most mathematical operations in Just BASIC can be performed on Literal Numbers, Numeric Variables, or Numeric Expressions that consist of Literal Numbers, Numeric Variables, or both.
There are 2 * pi radians in a full circle of 360 degrees. A formula to convert degrees to radians is: radians = degrees divided by 57.29577951.
Some helpful functions to convert between radians and degrees are available at the ACS() and ASN() function pages.

Example

Print COS(1)
Print COS(0.5)
Print COS(-0.2)
Print COS(-1/2)
End

Useful Procedures

' Place a useful function using this keyword here