_rotation.pyi 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. from __future__ import annotations
  2. from typing import TYPE_CHECKING, Union, Tuple, Optional, Sequence
  3. import numpy as np
  4. if TYPE_CHECKING:
  5. import numpy.typing as npt
  6. _IntegerType = Union[int, np.integer]
  7. class Rotation:
  8. def __init__(self, quat: npt.ArrayLike, normalize: bool = ..., copy: bool = ...) -> None: ...
  9. @property
  10. def single(self) -> bool: ...
  11. def __len__(self) -> int: ...
  12. @classmethod
  13. def from_quat(cls, quat: npt.ArrayLike) -> Rotation: ...
  14. @classmethod
  15. def from_matrix(cls, matrix: npt.ArrayLike) -> Rotation: ...
  16. @classmethod
  17. def from_rotvec(cls, rotvec: npt.ArrayLike) -> Rotation: ...
  18. @classmethod
  19. def from_euler(cls, seq: str, angles: Union[float, npt.ArrayLike], degrees: bool = ...) -> Rotation: ...
  20. @classmethod
  21. def from_mrp(cls, mrp: npt.ArrayLike) -> Rotation: ...
  22. def as_quat(self) -> np.ndarray: ...
  23. def as_matrix(self) -> np.ndarray: ...
  24. def as_rotvec(self) -> np.ndarray: ...
  25. def as_euler(self, seq: str, degrees: bool = ...) -> np.ndarray: ...
  26. def as_mrp(self) -> np.ndarray: ...
  27. @classmethod
  28. def concatenate(cls, rotations: Sequence[Rotation]) -> Rotation: ...
  29. def apply(self, vectors: npt.ArrayLike, inverse: bool = ...) -> np.ndarray: ...
  30. def __mul__(self, other: Rotation) -> Rotation: ...
  31. def inv(self) -> Rotation: ...
  32. def magnitude(self) -> Union[np.ndarray, float]: ...
  33. def mean(self, weights: Optional[npt.ArrayLike] = ...) -> Rotation: ...
  34. def reduce(self, left: Optional[Rotation] = ..., right: Optional[Rotation] = ...,
  35. return_indices: bool = ...) -> Union[Rotation, Tuple[Rotation, np.ndarray, np.ndarray]]: ...
  36. @classmethod
  37. def create_group(cls, group: str, axis: str = ...) -> Rotation: ...
  38. def __getitem__(self, indexer: Union[int, slice, npt.ArrayLike]) -> Rotation: ...
  39. @classmethod
  40. def identity(cls, num: Optional[int] = ...) -> Rotation: ...
  41. @classmethod
  42. def random(cls, num: Optional[int] = ...,
  43. random_state: Optional[Union[_IntegerType,
  44. np.random.Generator,
  45. np.random.RandomState]] = ...) -> Rotation: ...
  46. @classmethod
  47. def align_vectors(cls, a: npt.ArrayLike, b: npt.ArrayLike,
  48. weights: Optional[npt.ArrayLike] = ...,
  49. return_sensitivity: bool = ...) -> Union[Tuple[Rotation, float], Tuple[Rotation, float, np.ndarray]]:...
  50. class Slerp:
  51. def __init__(self, times: npt.ArrayLike, rotations: Rotation) -> None: ...
  52. def __call__(self, times: npt.ArrayLike) -> Rotation: ...