MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / rotmat

Function rotmat

scripts/n3v2blender.py:212–218  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

210 return (oa+ta*da+ob+tb*db) * 0.5, denom
211
212def rotmat(a, b):
213 a, b = a / np.linalg.norm(a), b / np.linalg.norm(b)
214 v = np.cross(a, b)
215 c = np.dot(a, b)
216 s = np.linalg.norm(v)
217 kmat = np.array([[0, -v[2], v[1]], [v[2], 0, -v[0]], [-v[1], v[0], 0]])
218 return np.eye(3) + kmat + kmat.dot(kmat) * ((1 - c) / (s ** 2 + 1e-10))
219
220if __name__ == '__main__':
221 parser = argparse.ArgumentParser() # TODO: refine it.

Callers 1

n3v2blender.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected