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

Function _quat_real

mne/transforms.py:1423–1434  ·  view source on GitHub ↗

Get the real part of our 3-element quat.

(quat)

Source from the content-addressed store, hash-verified

1421
1422
1423def _quat_real(quat):
1424 """Get the real part of our 3-element quat."""
1425 assert quat.shape[-1] == 3, quat.shape[-1]
1426 return np.sqrt(
1427 np.maximum(
1428 1.0
1429 - quat[..., 0] * quat[..., 0]
1430 - quat[..., 1] * quat[..., 1]
1431 - quat[..., 2] * quat[..., 2],
1432 0.0,
1433 )
1434 )
1435
1436
1437def _quat_mult(one, two):

Callers 5

test_average_quatsFunction · 0.90
_angle_between_quatsFunction · 0.85
_quat_multFunction · 0.85
_average_quatsFunction · 0.85
_quat_to_eulerFunction · 0.85

Calls 2

sqrtMethod · 0.80
maximumMethod · 0.80

Tested by 1

test_average_quatsFunction · 0.72