Created
August 19, 2017 16:45
-
-
Save WeiTang114/c9ce27e931a8fcaab5f84579577cefca to your computer and use it in GitHub Desktop.
Uniformly sample quaternion with numpy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def rand_quat(): | |
q = np.random.normal(0.0, 1.0, 4) | |
q = q / np.linalg.norm(q) | |
return q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment