MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / qrot

Function qrot

common/camera.py:20–28  ·  view source on GitHub ↗
(q, v)

Source from the content-addressed store, hash-verified

18
19
20def 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
31def qinverse(q, inplace=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected