(q, v)
| 18 | |
| 19 | |
| 20 | def qrot(q, v): |
| 21 | assert q.shape[-1] == 4 |
| 22 | assert v.shape[-1] == 3 |
| 23 | assert q.shape[:-1] == v.shape[:-1] |
| 24 | |
| 25 | qvec = q[..., 1:] |
| 26 | uv = torch.cross(qvec, v, dim=len(q.shape) - 1) |
| 27 | uuv = torch.cross(qvec, uv, dim=len(q.shape) - 1) |
| 28 | return (v + 2 * (q[..., :1] * uv + uuv)) |
| 29 | |
| 30 | |
| 31 | def qinverse(q, inplace=False): |
nothing calls this directly
no outgoing calls
no test coverage detected