public static Vector2 Disk(ref NPack.MersenneTwister _rand, UnityRandom.Normalization n, float temp) { double t, theta; switch (n) { case UnityRandom.Normalization.STDNORMAL: t = NormalDistribution.Normalize(_rand.NextSingle(true), temp); theta = NormalDistribution.Normalize(_rand.NextSingle(true), temp) * 2 * Math.PI; break; case UnityRandom.Normalization.POWERLAW: t = PowerLaw.Normalize(_rand.NextSingle(true), temp, 0, 1); theta = PowerLaw.Normalize(_rand.NextSingle(true), temp, 0, 1) * 2 * Math.PI; break; default: t = (float)_rand.NextSingle(true); theta = _rand.NextSingle(false) * 2 * Math.PI; break; } return(new Vector2((float)(Math.Sqrt(t) * Math.Cos(theta)), (float)(Math.Sqrt(t) * Math.Sin(theta)))); }