Skip to content

Instantly share code, notes, and snippets.

@WeiTang114
Created August 19, 2017 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WeiTang114/c9ce27e931a8fcaab5f84579577cefca to your computer and use it in GitHub Desktop.
Save WeiTang114/c9ce27e931a8fcaab5f84579577cefca to your computer and use it in GitHub Desktop.
Uniformly sample quaternion with numpy.
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