public static void GetSphericalDistribution( out float xAngle, out float yAngle, ref Random32 random) { yAngle = random.GetFloat(-Mathf.PI, Mathf.PI); var r = random.GetFloat(); xAngle = Mathf.Asin((2f * r) - 1f); }
public static void GetHemisphericalDistribution( out float xAngle, out float yAngle, ref Random32 random) { yAngle = random.GetFloat(-Mathf.PI, Mathf.PI); var r = random.GetFloat(); xAngle = Mathf.Acos(r); }
public static void GetHemisphericalCosPoweredDistribution( out float xAngle, out float yAngle, float power, ref Random32 random) { yAngle = random.GetFloat(-Mathf.PI, Mathf.PI); var r = random.GetFloat(); var powered = Mathf.Pow(r, 1f / (power + 1f)); xAngle = Mathf.Acos(powered); }