Generate a random point with an anullus.

Ive been searching this up but it is in some obscure crappy language called mathematica. Basically i am trying to generate a random point around the player to spawn the unistorm thunder effect at, as i am wanting a more realistic sound and shadow from them.

alt text

Essentially i want to specify a min distance and a max distance for the bolt to spawn in around the player. It would then pick a random point within the yellow area to spawn the bolt. What would be the most efficient way of generating these results?

Something like this should work(pseudo code), you will still have to decide on a height.

//Pick a random direction.
var Direction_Vector : Vector3 = Vector3.zero;

while (Direction_Vector == Vector3.zero) {
    Direction_Vector = Vector3(Random.Range(-1.0, 1.0), 0, Random.Range(-1.0, 1.0));
}

//Normalise it.
Direction_Vector = Direction_Vector.normalized;

//Assuming the small circle radius is 5 and the large radius is 10.
Magnitude = Random.Range(5, 10);

//Create you spawn Vector
Spawn_Vector = Direction_Vector * Magnitude;

//Height Vector, ten high (change to what you want).
Height_Vector = Vector3(0, 10, 0);

//Use Spawn Vector in relation to character position to get spawn position.
//and adjust with the Height_Vector.
Spawn_Position = Character.transform.position + Spawn_Vector + Height_Vector;

THe interpreter moans about multiplying vector twos. Ive tryed storing them in temp variables as X,Y but it produces some dodgy results,