vector4 sample_orientation_cone(vector4 center, float maxangle, vector u)
Orientation in the center of the cone. This does not need to be normalized.
Maximum angle, in radians, away from
center that any sample of the cone
will be, so long as all
u values are between 0 and 1.
This angle is the maximum quaternion rotation angle between the orientation quaternion that the output represents and
center, which is twice the Euclidean cone angle of the unit 4D hypersphere being sampled. A
maxangle of π would sample all orientations, but only half of all 4D unit vectors; a
maxangle of 2π would sample all 4D unit vectors.
Three numbers between 0 and 1.
Returns a unit vector4, i.e. a vector4 of length 1, based on
Given uniform random
u vectors of three values in [0,1), the returned quaternion
orientations will be uniform random and continuous with respect to
in the region of orientations within