MCPcopy
hub / github.com/mne-tools/mne-python / rotation

Function rotation

mne/transforms.py:289–304  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

287
288
289def 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
307def rotation3d(x=0, y=0, z=0):

Callers 11

test_scale_mri_xfmFunction · 0.90
test_fit_matched_pointsFunction · 0.90
test_rotationFunction · 0.90
test_eulerFunction · 0.90
_trans_from_paramsFunction · 0.85
errorFunction · 0.85
_update_paramsMethod · 0.85
_changesMethod · 0.85
_plot_mri_fiducialsFunction · 0.85

Calls 1

rotation3dFunction · 0.85

Tested by 6

test_scale_mri_xfmFunction · 0.72
test_fit_matched_pointsFunction · 0.72
test_rotationFunction · 0.72
test_eulerFunction · 0.72