Random.insideUnitCircle dots math equivalent API

What is the dots math equivalent API for Random.insideUnitCircle?

https://docs.unity3d.com/Packages/com.unity.mathematics@0.0/api/Unity.Mathematics.Random.html

Unity.mathematics.Random.NextFloat2Direction()

This would be the UnityEngine.Random.onUnitCircle / onUnitSphere for the float3 equivalent)

You can multiply this with a Random.NextFloat to get any point in the unit circle. Please note that the distribution is not even (more dense towards the center of the circle), you can take the square root of the float to get a more even distribution, or the cubic root for the insideUnitSphere equivalent.

6 Likes