mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
pybricks.tools: Document cross product.
This commit is contained in:
@@ -31,3 +31,5 @@
|
||||
.. pybricks-requirements:: stm32-float
|
||||
|
||||
.. autofunction:: pybricks.tools.vector
|
||||
|
||||
.. autofunction:: pybricks.tools.cross
|
||||
|
||||
@@ -155,6 +155,7 @@ def test_from_pybricks_tools_import():
|
||||
code = "from pybricks.tools import "
|
||||
completions: list[CompletionItem] = json.loads(complete(code, 1, len(code) + 1))
|
||||
assert [c["insertText"] for c in completions] == [
|
||||
"cross",
|
||||
"DataLog",
|
||||
"Matrix",
|
||||
"StopWatch",
|
||||
|
||||
@@ -207,6 +207,21 @@ def vector(*args):
|
||||
"""
|
||||
|
||||
|
||||
def cross(a: Matrix, b: Matrix) -> Matrix:
|
||||
"""
|
||||
cross(a, b) -> Matrix
|
||||
|
||||
Gets the cross product ``a`` × ``b`` of two vectors.
|
||||
|
||||
Arguments:
|
||||
a (Matrix): A three-dimensional vector.
|
||||
b (Matrix): A three-dimensional vector.
|
||||
|
||||
Returns:
|
||||
The cross product, also a three-dimensional vector.
|
||||
"""
|
||||
|
||||
|
||||
# HACK: hide from jedi
|
||||
if TYPE_CHECKING:
|
||||
del Number
|
||||
|
||||
Reference in New Issue
Block a user