Macaulay2 » Documentation
Packages » Python » PythonObject » cos(PythonObject)
next | previous | forward | backward | up | index | toc

# cos(PythonObject) -- cosine of a python object

- Function: cos
- Usage:
    `cos x`
- Inputs:
  - x, a python object,
- Outputs:
  - a python object,

## Description

This calls Python's built-in `math.cos` function, which computes the cosine of x.

    i1 : cos toPython 0

    o1 = 1.0

    o1 : PythonObject of class float

    i2 : cos toPython (pi / 2)

    o2 = 6.123233995736766e-17

    o2 : PythonObject of class float

## See also

- acos(PythonObject) -- arc cosine of a python object
- sin(PythonObject) -- sine of a python object
- tan(PythonObject) -- tangent of a python object

## Ways to use this method:

- cos(PythonObject) -- cosine of a python object

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Python/doc/trig.m2:133:0.