Create an array with a 4 dimensional rotation matrix. Parameters ---------- x, y, z : scalar Rotation around the origin (in rad). Returns ------- r : array, shape = (4, 4) The rotation matrix.
(x=0, y=0, z=0)
| 287 | |
| 288 | |
| 289 | def rotation(x=0, y=0, z=0): |
| 290 | """Create an array with a 4 dimensional rotation matrix. |
| 291 | |
| 292 | Parameters |
| 293 | ---------- |
| 294 | x, y, z : scalar |
| 295 | Rotation around the origin (in rad). |
| 296 | |
| 297 | Returns |
| 298 | ------- |
| 299 | r : array, shape = (4, 4) |
| 300 | The rotation matrix. |
| 301 | """ |
| 302 | r = np.eye(4) |
| 303 | r[:3, :3] = rotation3d(x=x, y=y, z=z) |
| 304 | return r |
| 305 | |
| 306 | |
| 307 | def rotation3d(x=0, y=0, z=0): |