mercredi 21 août 2019

Create random uniform vector

Given gunction float frand(), that generates uniformly-distributed random floating point value, in range [0.0, 1.0)

How can I create uniformly-distributed random 3D unit vector, and 4D unit quaternion? (so that a 3D vector lies on a unit sphere, and 4D - on a unit hypersphere, and vectors are uniformly-distributed among correspoiding surface)




Aucun commentaire:

Enregistrer un commentaire