Project/02 - Engine/LittleBigEngine/Utils/RandomHelper.cs
/// <summary>
/// Returns a random normalized 2d vector
/// </summary>
/// <param name="random"></param>
/// <returns></returns>
Returns a random normalized 2d vector
Returns a random normalized 2d vector
public static Vector2 NextVector2(this Random random)
        {
            float angle = random.NextFloat() * 2 * (float)Math.PI;
            return new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
        }
public static Vector2 NextVector2 ( this Random random ) { float angle = random . NextFloat ( ) * 2 * ( float ) Math . PI ; return new Vector2 ( ( float ) Math . Cos ( angle ) , ( float ) Math . Sin ( angle ) ) ; }
Returns a random normalized 2d vector
Returns a random normalized 2d vector
None
Random
this
random
None