XLISP cos

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# cos

Type: | - | function (subr)
Source: | - | xlmath.c

## Syntax

(cos expr)
  expr - floating point number/expression
  returns - the cosine of the number

## Description

The 'cos' function returns the cosine of the 'expr'. The 'expr' is in radians.

## Examples

    (cos 0.0)            ; returns 1
    (cos (/ 3.14159 2))  ; returns 1.32679e-06 (almost 0)
    (cos .5)             ; returns 0.877583
    (cos 0)              ; error: bad integer operation
    (cos 1.)             ; error: bad integer operation

See the cos function in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference