Cone from direction vector
<p>I have a normalized direction vector (from a 3d position to a light position) and I would like this vector to be rotated by some angle so I can create a "cone".</p>

<p>Id like to simulate cone tracing by using the direction vector as the center of the cone and create an X number of samples to create more rays to sample from.</p>

<p>What I would like to know is basically the math behind:</p>

<p><a href="https://docs.unrealengine.com/latest/INT/BlueprintAPI/Math/Random/RandomUnitVectorinCone/index.html" rel="nofollow">https://docs.unrealengine.com/latest/INT/BlueprintAPI/Math/Random/RandomUnitVectorinCone/index.html</a></p>

<p>Which seems to do exactly what Im looking for.</p>