提交 a997aee9 编写于 作者: I Ivan Kuzev

Update doc/api/core/Math.rst

上级 e764a77b
Math - Math utility functions
-----------------------------
**function**::THREE.Math.clamp(*x*, *a*, *b*)
.. js:class:: Math()
Clamps the *x* to be between *a* and *b*
Math utility functions
\ No newline at end of file
+-----------+-------+----------------------+
| Parameter | Type | Description |
+===========+=======+======================+
| *x* | float | value to be clamped |
+-----------+-------+----------------------+
| *a* | float | minimum value |
+-----------+-------+----------------------+
| *b* | float | maximum value |
+-----------+-------+----------------------+
| returns | float | value after clamping |
+-----------+-------+----------------------+
**function**::THREE.Math.clampBottom(*x*, *a*)
Clamps the *x* to be larger than *a*
+-----------+-------+----------------------+
| Parameter | Type | Description |
+===========+=======+======================+
| *x* | float | value to be clamped |
+-----------+-------+----------------------+
| *a* | float | minimum value |
+-----------+-------+----------------------+
| returns | float | value after clamping |
+-----------+-------+----------------------+
**function**::THREE.Math.mapLinear(*x*, *a1*, *a2*, *b1*, *b2*)
//todo
**function**::THREE.Math.random16()
+-----------+-------+-----------------------------------------------------+
| Parameter | Type | Description |
+===========+=======+=====================================================+
| returns | float | Random float from <0, 1> with 16 bits of randomness |
+-----------+-------+-----------------------------------------------------+
(standard Math.random() creates repetitive patterns when applied over larger space)
**function**::THREE.Math.randInt(*low*, *high*)
+-----------+---------+----------------------------------------------+
| Parameter | Type | Description |
+===========+=========+==============================================+
| returns | integer | Random integer from *low* to *high* interval |
+-----------+---------+----------------------------------------------+
**function**::THREE.Math.randFloat(*low*, *high*)
+-----------+-------+--------------------------------------------+
| Parameter | Type | Description |
+===========+=======+============================================+
| returns | float | Random float from *low* to *high* interval |
+-----------+-------+--------------------------------------------+
**function**::THREE.Math.randFloatSpread(*range*)
+-----------+-------+---------------------------------------------------+
| Parameter | Type | Description |
+===========+=======+===================================================+
| returns | float | Random float from -*range*/2 to *range*/2 interval|
+-----------+-------+---------------------------------------------------+
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册