Get the real part of our 3-element quat.
(quat)
| 1421 | |
| 1422 | |
| 1423 | def _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 | |
| 1437 | def _quat_mult(one, two): |