Euler angle
beignet.apply_euler_angle
apply_euler_angle(input, rotation, axes, degrees=False, inverse=False)
Rotates vectors in three-dimensional space using Euler angles.
Note
This function interprets the rotation of the original frame to the final frame as either a projection, where it maps the components of vectors from the final frame to the original frame, or as a physical rotation, integrating the vectors into the original frame during the rotation process. Consequently, the vector components are maintained in the original frame’s perspective both before and after the rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor
|
Vectors in three-dimensional space with the shape \((\ldots \times 3)\). Euler angles and vectors must conform to PyTorch broadcasting rules. |
required |
rotation
|
Tensor
|
Euler angles with the shape \((\ldots \times 3)\), specifying the rotation in three-dimensional space. |
required |
axes
|
str
|
Specifies the sequence of axes for the rotations, using one to three
characters from the set \({X, Y, Z}\) for intrinsic rotations, or
\({x, y, z}\) for extrinsic rotations. Mixing extrinsic and intrinsic
rotations raises a |
required |
degrees
|
bool
|
Indicates whether the Euler angles are provided in degrees. If |
False
|
inverse
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor
|
A tensor of the same shape as |
Source code in src/beignet/_apply_euler_angle.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
beignet.compose_euler_angle
compose_euler_angle(input, other, axes, degrees=False)
Compose rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Euler angles. |
required |
other
|
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes
|
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Composed Euler angles. |
Source code in src/beignet/_compose_euler_angle.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
beignet.euler_angle_identity
euler_angle_identity(size, axes, degrees=False, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Identity Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size
|
int
|
Output size. |
required |
axes
|
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees
|
bool
|
If |
False
|
out
|
Tensor
|
Output tensor. Default, |
None
|
dtype
|
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout
|
layout
|
Layout of the returned tensor. Default, |
strided
|
device
|
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad
|
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
Returns:
Name | Type | Description |
---|---|---|
identity_euler_angles |
(Tensor, shape(size, 3))
|
Identity Euler angles. |
Source code in src/beignet/_euler_angle_identity.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
beignet.euler_angle_magnitude
euler_angle_magnitude(input, axes, degrees=False)
Euler angle magnitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
(Tensor, shape(..., 3))
|
Euler angles. |
required |
axes
|
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
euler_angle_magnitudes |
(Tensor, shape(...))
|
Angles in radians. Magnitudes will be in the range :math: |
Source code in src/beignet/_euler_angle_magnitude.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
beignet.euler_angle_mean
euler_angle_mean(input, weight=None, axes=None, degrees=False)
Euler angle mean.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Euler angles. |
required |
weight
|
Tensor, shape=(..., 4)
|
Relative importance of rotation quaternions. |
None
|
axes
|
str
|
Axes. One to three characters belonging to the set :math: |
None
|
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Euler angle mean. |
Source code in src/beignet/_euler_angle_mean.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
beignet.euler_angle_to_quaternion
euler_angle_to_quaternion(input, axes, degrees=False, canonical=False)
Convert Euler angles to rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes
|
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees
|
bool
|
If |
False
|
canonical
|
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation quaternions. |
Source code in src/beignet/_euler_angle_to_quaternion.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
beignet.euler_angle_to_rotation_matrix
euler_angle_to_rotation_matrix(input, axes, degrees=False)
Convert Euler angles to rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes
|
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
Source code in src/beignet/_euler_angle_to_rotation_matrix.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
beignet.euler_angle_to_rotation_vector
euler_angle_to_rotation_vector(input, axes, degrees=False)
Convert Euler angles to rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes
|
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Rotation vectors. |
Source code in src/beignet/_euler_angle_to_rotation_vector.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
beignet.invert_euler_angle
invert_euler_angle(input, axes, degrees=False)
Invert Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
(Tensor, shape(..., 3))
|
Euler angles. |
required |
axes
|
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
inverted_euler_angles |
(Tensor, shape(..., 3))
|
Inverted Euler angles. |
Source code in src/beignet/_invert_euler_angle.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
beignet.random_euler_angle
random_euler_angle(size, axes, degrees=False, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False)
Generate random Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size
|
int
|
Output size. |
required |
axes
|
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees
|
bool
|
If |
False
|
generator
|
Generator
|
Psuedo-random number generator. Default, |
None
|
out
|
Tensor
|
Output tensor. Default, |
None
|
dtype
|
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout
|
layout
|
Layout of the returned tensor. Default, |
strided
|
device
|
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad
|
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
pin_memory
|
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
random_euler_angles |
(Tensor, shape(..., 3))
|
Random Euler angles. The returned Euler angles are in the range:
|
Source code in src/beignet/_random_euler_angle.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|