Files
pybricks-api/doc/api/umath.rst
T
Laurens Valk 727ec3fe46 umath: Redo module docs.
This reworks the documentation for the umath module, as done previously as per https://github.com/pybricks/pybricks-api/pull/64 and https://github.com/pybricks/pybricks-api/issues/63

The presentation and docstrings are inspired by the Python 3 math module documentation instead of the MicroPython math module documentation. Functions are grouped roughly by use case.
2021-07-14 11:22:04 +02:00

78 lines
1.3 KiB
ReStructuredText

:mod:`umath <umath>` -- Math functions
============================================================
This module is available on the the City Hub, Technic Hub,
Prime Hub, and Inventor Hub.
This MicroPython module is similar to the `math module`_ in Python.
.. module:: umath
Rounding and sign
-------------------------------------
.. autofunction:: umath.ceil
.. autofunction:: umath.floor
.. autofunction:: umath.trunc
.. autofunction:: umath.fmod
.. autofunction:: umath.fabs
.. autofunction:: umath.copysign
Powers and logarithms
-------------------------------
.. autodata:: umath.e
.. autofunction:: umath.exp
.. autofunction:: umath.pow
.. autofunction:: umath.log
.. autofunction:: umath.sqrt
Trigonomety
-------------------------------
.. autodata:: umath.pi
.. autofunction:: umath.degrees
.. autofunction:: umath.radians
.. autofunction:: umath.sin
.. autofunction:: umath.asin
.. autofunction:: umath.cos
.. autofunction:: umath.acos
.. autofunction:: umath.tan
.. autofunction:: umath.atan
.. autofunction:: umath.atan2
Other math functions
-------------------------------
.. autofunction:: umath.isfinite
.. autofunction:: umath.isinfinite
.. autofunction:: umath.isnan
.. autofunction:: umath.modf
.. autofunction:: umath.frexp
.. autofunction:: umath.ldexp
.. _math module: https://docs.python.org/3.5/library/math.html#module-math