MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / rotate3d

Function rotate3d

datasets/augmentv2.py:121–129  ·  view source on GitHub ↗
(v, theta, **kwargs)

Source from the content-addressed store, hash-verified

119 **kwargs)
120
121def rotate3d(v, theta, **kwargs):
122 vx = v[..., 0]; vy = v[..., 1]; vz = v[..., 2]
123 s = torch.sin(theta); c = torch.cos(theta); cc = 1 - c
124 return matrix(
125 [vx*vx*cc+c, vx*vy*cc-vz*s, vx*vz*cc+vy*s, 0],
126 [vy*vx*cc+vz*s, vy*vy*cc+c, vy*vz*cc-vx*s, 0],
127 [vz*vx*cc-vy*s, vz*vy*cc+vx*s, vz*vz*cc+c, 0],
128 [0, 0, 0, 1],
129 **kwargs)
130
131def translate2d_inv(tx, ty, **kwargs):
132 return translate2d(-tx, -ty, **kwargs)

Callers 1

__call__Method · 0.85

Calls 1

matrixFunction · 0.85

Tested by

no test coverage detected