pybricks.geometry: add Axis.ANY

This exists in the firmware but was missing here.
This commit is contained in:
David Lechner
2021-12-16 15:08:50 -06:00
parent 7f4234fc1e
commit c666009511
2 changed files with 8 additions and 4 deletions
+5 -3
View File
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2018-2020 The Pybricks Authors
# Copyright (c) 2018-2021 The Pybricks Authors
"""Core linear algebra functionality for orientation sensors and robotics."""
@@ -42,19 +42,21 @@ def vector(x, y, z=None):
Returns:
Matrix: A matrix with the shape of a column vector.
Matrix: A matrix with the shape of a column vector.
"""
pass
class Axis():
class Axis:
"""Unit axes of a coordinate system.
.. data:: X = vector(1, 0, 0)
.. data:: Y = vector(0, 1, 0)
.. data:: Z = vector(0, 0, 1)
.. data:: ANY = None
"""
X = vector(1, 0, 0)
Y = vector(0, 1, 0)
Z = vector(0, 0, 1)
ANY = None
+3 -1
View File
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2020 The Pybricks Authors
# Copyright (c) 2020-2021 The Pybricks Authors
from _typeshed import NoneType
from typing import Collection, Optional, Tuple
class Matrix:
@@ -16,3 +17,4 @@ class Axis:
X: Matrix
Y: Matrix
Z: Matrix
ANY: NoneType