Skip to content

Commit

Permalink
rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
0x00b1 committed Apr 8, 2024
1 parent d1fa58c commit 14fce45
Show file tree
Hide file tree
Showing 45 changed files with 216 additions and 219 deletions.
52 changes: 26 additions & 26 deletions src/beignet/ops/__init__.py
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
from ._geometry import (
apply_euler_angle,
apply_rotation_matrix,
apply_rotation_quaternion,
apply_quaternion,
apply_rotation_vector,
compose_rotation_quaternion,
compose_quaternion,
euler_angle_identity,
euler_angle_magnitude,
euler_angle_to_rotation_matrix,
euler_angle_to_rotation_quaternion,
euler_angle_to_quaternion,
euler_angle_to_rotation_vector,
invert_euler_angle,
invert_rotation_matrix,
invert_rotation_quaternion,
invert_quaternion,
invert_rotation_vector,
mean_rotation_quaternion,
mean_quaternion,
random_euler_angle,
random_rotation_matrix,
random_rotation_quaternion,
random_quaternion,
random_rotation_vector,
rotation_matrix_identity,
rotation_matrix_magnitude,
rotation_matrix_to_euler_angle,
rotation_matrix_to_rotation_quaternion,
rotation_matrix_to_quaternion,
rotation_matrix_to_rotation_vector,
rotation_quaternion_identity,
rotation_quaternion_magnitude,
rotation_quaternion_to_euler_angle,
rotation_quaternion_to_rotation_matrix,
rotation_quaternion_to_rotation_vector,
quaternion_identity,
quaternion_magnitude,
quaternion_to_euler_angle,
quaternion_to_rotation_matrix,
quaternion_to_rotation_vector,
rotation_vector_identity,
rotation_vector_magnitude,
rotation_vector_to_euler_angle,
rotation_vector_to_rotation_matrix,
rotation_vector_to_rotation_quaternion,
rotation_vector_to_quaternion,
translation_identity,
)
from ._interpolation import slerp

__all__ = [
"apply_euler_angle",
"apply_rotation_matrix",
"apply_rotation_quaternion",
"apply_quaternion",
"apply_rotation_vector",
"compose_rotation_quaternion",
"compose_quaternion",
"euler_angle_identity",
"euler_angle_magnitude",
"euler_angle_to_rotation_matrix",
"euler_angle_to_rotation_quaternion",
"euler_angle_to_quaternion",
"euler_angle_to_rotation_vector",
"invert_euler_angle",
"invert_rotation_matrix",
"invert_rotation_quaternion",
"invert_quaternion",
"invert_rotation_vector",
"mean_rotation_quaternion",
"mean_quaternion",
"random_euler_angle",
"random_rotation_matrix",
"random_rotation_quaternion",
"random_quaternion",
"random_rotation_vector",
"rotation_matrix_identity",
"rotation_matrix_magnitude",
"rotation_matrix_to_euler_angle",
"rotation_matrix_to_rotation_quaternion",
"rotation_matrix_to_quaternion",
"rotation_matrix_to_rotation_vector",
"rotation_quaternion_identity",
"rotation_quaternion_magnitude",
"rotation_quaternion_to_euler_angle",
"rotation_quaternion_to_rotation_matrix",
"rotation_quaternion_to_rotation_vector",
"quaternion_identity",
"quaternion_magnitude",
"quaternion_to_euler_angle",
"quaternion_to_rotation_matrix",
"quaternion_to_rotation_vector",
"rotation_vector_identity",
"rotation_vector_magnitude",
"rotation_vector_to_euler_angle",
"rotation_vector_to_rotation_matrix",
"rotation_vector_to_rotation_quaternion",
"rotation_vector_to_quaternion",
"slerp",
"translation_identity",
]
26 changes: 13 additions & 13 deletions src/beignet/ops/_geometry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
from ._transformations import (
apply_euler_angle,
apply_rotation_matrix,
apply_rotation_quaternion,
apply_quaternion,
apply_rotation_vector,
compose_rotation_quaternion,
compose_quaternion,
euler_angle_identity,
euler_angle_magnitude,
euler_angle_to_rotation_matrix,
euler_angle_to_rotation_quaternion,
euler_angle_to_quaternion,
euler_angle_to_rotation_vector,
invert_euler_angle,
invert_rotation_matrix,
invert_rotation_quaternion,
invert_quaternion,
invert_rotation_vector,
mean_rotation_quaternion,
mean_quaternion,
random_euler_angle,
random_rotation_matrix,
random_rotation_quaternion,
random_quaternion,
random_rotation_vector,
rotation_matrix_identity,
rotation_matrix_magnitude,
rotation_matrix_to_euler_angle,
rotation_matrix_to_rotation_quaternion,
rotation_matrix_to_quaternion,
rotation_matrix_to_rotation_vector,
rotation_quaternion_identity,
rotation_quaternion_magnitude,
rotation_quaternion_to_euler_angle,
rotation_quaternion_to_rotation_matrix,
rotation_quaternion_to_rotation_vector,
quaternion_identity,
quaternion_magnitude,
quaternion_to_euler_angle,
quaternion_to_rotation_matrix,
quaternion_to_rotation_vector,
rotation_vector_identity,
rotation_vector_magnitude,
rotation_vector_to_euler_angle,
rotation_vector_to_rotation_matrix,
rotation_vector_to_rotation_quaternion,
rotation_vector_to_quaternion,
translation_identity,
)
26 changes: 13 additions & 13 deletions src/beignet/ops/_geometry/_transformations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
from ._rotations import (
apply_euler_angle,
apply_rotation_matrix,
apply_rotation_quaternion,
apply_quaternion,
apply_rotation_vector,
compose_rotation_quaternion,
compose_quaternion,
euler_angle_identity,
euler_angle_magnitude,
euler_angle_to_rotation_matrix,
euler_angle_to_rotation_quaternion,
euler_angle_to_quaternion,
euler_angle_to_rotation_vector,
invert_euler_angle,
invert_rotation_matrix,
invert_rotation_quaternion,
invert_quaternion,
invert_rotation_vector,
mean_rotation_quaternion,
mean_quaternion,
random_euler_angle,
random_rotation_matrix,
random_rotation_quaternion,
random_quaternion,
random_rotation_vector,
rotation_matrix_identity,
rotation_matrix_magnitude,
rotation_matrix_to_euler_angle,
rotation_matrix_to_rotation_quaternion,
rotation_matrix_to_quaternion,
rotation_matrix_to_rotation_vector,
rotation_quaternion_identity,
rotation_quaternion_magnitude,
rotation_quaternion_to_euler_angle,
rotation_quaternion_to_rotation_matrix,
rotation_quaternion_to_rotation_vector,
quaternion_identity,
quaternion_magnitude,
quaternion_to_euler_angle,
quaternion_to_rotation_matrix,
quaternion_to_rotation_vector,
rotation_vector_identity,
rotation_vector_magnitude,
rotation_vector_to_euler_angle,
rotation_vector_to_rotation_matrix,
rotation_vector_to_rotation_quaternion,
rotation_vector_to_quaternion,
)
from ._translations import translation_identity
40 changes: 20 additions & 20 deletions src/beignet/ops/_geometry/_transformations/_rotations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
from ._apply_euler_angle import apply_euler_angle
from ._apply_rotation_matrix import apply_rotation_matrix
from ._apply_rotation_quaternion import (
apply_rotation_quaternion,
from ._apply_quaternion import (
apply_quaternion,
)
from ._apply_rotation_vector import apply_rotation_vector
from ._compose_rotation_quaternion import compose_rotation_quaternion
from ._compose_quaternion import compose_quaternion
from ._euler_angle_identity import euler_angle_identity
from ._euler_angle_magnitude import euler_angle_magnitude
from ._euler_angle_to_rotation_matrix import euler_angle_to_rotation_matrix
from ._euler_angle_to_rotation_quaternion import (
euler_angle_to_rotation_quaternion,
from ._euler_angle_to_quaternion import (
euler_angle_to_quaternion,
)
from ._euler_angle_to_rotation_vector import euler_angle_to_rotation_vector
from ._invert_euler_angle import invert_euler_angle
from ._invert_rotation_matrix import invert_rotation_matrix
from ._invert_rotation_quaternion import invert_rotation_quaternion
from ._invert_quaternion import invert_quaternion
from ._invert_rotation_vector import invert_rotation_vector
from ._mean_rotation_quaternion import mean_rotation_quaternion
from ._mean_quaternion import mean_quaternion
from ._random_euler_angle import random_euler_angle
from ._random_rotation_matrix import random_rotation_matrix
from ._random_rotation_quaternion import random_rotation_quaternion
from ._random_quaternion import random_quaternion
from ._random_rotation_vector import random_rotation_vector
from ._rotation_matrix_identity import rotation_matrix_identity
from ._rotation_matrix_magnitude import rotation_matrix_magnitude
from ._rotation_matrix_to_euler_angle import rotation_matrix_to_euler_angle
from ._rotation_matrix_to_rotation_quaternion import (
rotation_matrix_to_rotation_quaternion,
from ._rotation_matrix_to_quaternion import (
rotation_matrix_to_quaternion,
)
from ._rotation_matrix_to_rotation_vector import (
rotation_matrix_to_rotation_vector,
)
from ._rotation_quaternion_identity import rotation_quaternion_identity
from ._rotation_quaternion_magnitude import rotation_quaternion_magnitude
from ._rotation_quaternion_to_euler_angle import (
rotation_quaternion_to_euler_angle,
from ._quaternion_identity import quaternion_identity
from ._quaternion_magnitude import quaternion_magnitude
from ._quaternion_to_euler_angle import (
quaternion_to_euler_angle,
)
from ._rotation_quaternion_to_rotation_matrix import (
rotation_quaternion_to_rotation_matrix,
from ._quaternion_to_rotation_matrix import (
quaternion_to_rotation_matrix,
)
from ._rotation_quaternion_to_rotation_vector import (
rotation_quaternion_to_rotation_vector,
from ._quaternion_to_rotation_vector import (
quaternion_to_rotation_vector,
)
from ._rotation_vector_identity import rotation_vector_identity
from ._rotation_vector_magnitude import rotation_vector_magnitude
from ._rotation_vector_to_euler_angle import rotation_vector_to_euler_angle
from ._rotation_vector_to_rotation_matrix import (
rotation_vector_to_rotation_matrix,
)
from ._rotation_vector_to_rotation_quaternion import (
rotation_vector_to_rotation_quaternion,
from ._rotation_vector_to_quaternion import (
rotation_vector_to_quaternion,
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from torch import Tensor

from ._rotation_quaternion_to_rotation_matrix import (
rotation_quaternion_to_rotation_matrix,
from ._quaternion_to_rotation_matrix import (
quaternion_to_rotation_matrix,
)
from ._apply_rotation_matrix import apply_rotation_matrix


def apply_rotation_quaternion(
def apply_quaternion(
input: Tensor,
rotation: Tensor,
inverse: bool | None = False,
Expand Down Expand Up @@ -45,7 +45,7 @@ def apply_rotation_quaternion(
"""
return apply_rotation_matrix(
input,
rotation_quaternion_to_rotation_matrix(
quaternion_to_rotation_matrix(
rotation,
),
inverse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from torch import Tensor

from ._rotation_quaternion_to_rotation_matrix import (
rotation_quaternion_to_rotation_matrix,
from ._quaternion_to_rotation_matrix import (
quaternion_to_rotation_matrix,
)
from ._rotation_vector_to_rotation_quaternion import (
rotation_vector_to_rotation_quaternion,
from ._rotation_vector_to_quaternion import (
rotation_vector_to_quaternion,
)
from ._apply_rotation_matrix import apply_rotation_matrix

Expand Down Expand Up @@ -53,8 +53,8 @@ def apply_rotation_vector(
"""
return apply_rotation_matrix(
input,
rotation_quaternion_to_rotation_matrix(
rotation_vector_to_rotation_quaternion(
quaternion_to_rotation_matrix(
rotation_vector_to_quaternion(
rotation,
degrees,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from torch import Tensor


def compose_rotation_quaternion(
def compose_quaternion(
input: Tensor,
other: Tensor,
canonical: bool = False,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
from torch import Tensor

from ._rotation_quaternion_identity import rotation_quaternion_identity
from ._rotation_quaternion_to_euler_angle import (
rotation_quaternion_to_euler_angle,
from ._quaternion_identity import quaternion_identity
from ._quaternion_to_euler_angle import (
quaternion_to_euler_angle,
)


Expand Down Expand Up @@ -56,8 +56,8 @@ def euler_angle_identity(
identity_euler_angles : Tensor, shape (size, 3)
Identity Euler angles.
"""
return rotation_quaternion_to_euler_angle(
rotation_quaternion_identity(
return quaternion_to_euler_angle(
quaternion_identity(
size,
out=out,
dtype=dtype,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from torch import Tensor

from ._euler_angle_to_rotation_quaternion import (
euler_angle_to_rotation_quaternion,
from ._euler_angle_to_quaternion import (
euler_angle_to_quaternion,
)
from ._rotation_quaternion_magnitude import rotation_quaternion_magnitude
from ._quaternion_magnitude import quaternion_magnitude


def euler_angle_magnitude(
Expand Down Expand Up @@ -32,8 +32,8 @@ def euler_angle_magnitude(
euler_angle_magnitudes: Tensor, shape (...)
Angles in radians. Magnitudes will be in the range :math:`[0, \pi]`.
"""
return rotation_quaternion_magnitude(
euler_angle_to_rotation_quaternion(
return quaternion_magnitude(
euler_angle_to_quaternion(
input,
axes,
degrees,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from torch import Tensor


def euler_angle_to_rotation_quaternion(
def euler_angle_to_quaternion(
input: Tensor,
axes: str,
degrees: bool = False,
Expand Down
Loading

0 comments on commit 14fce45

Please sign in to comment.