I'm not using Vectors, instead I have 2 coordinates.
In initialization phase I m doing:
float angle = random.Next(0,90);
parts.Angle_X = AngleToVector(angle)[0];
parts.Angle_Y = AngleToVector(angle)[1];
and this the way I m getting vector from angle:
private float[] AngleToVector(float angle)
{
//vector[0] = X;
//vector[1] = Y;
float[] vector = new float[2];
vector[0] = (float)Math.Cos(angle);
vector[1] = (float)Math.Sin(angle);
return vector;
}
I update my particles position:
parts.Position_X += parts.Angle_X * parts.Velocity;
parts.Position_Y += parts.Angle_Y * parts.Velocity;
what I get after this is :
particles are spread not from 0 till 90 but all over the screen.
When I m using random.nextDouble() I m getting spread angle:
How can I control the angle, so when angle is from 0 to 90 it would be upper right square, from 90 to 180 - upper left and so on?