mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 17:46:19 +00:00
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.
This commit is contained in:
+76
-3
@@ -1,4 +1,77 @@
|
||||
:mod:`umath` -- Mathematical functions
|
||||
======================================
|
||||
:mod:`umath <umath>` -- Math functions
|
||||
============================================================
|
||||
|
||||
.. automodule:: umath
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user