# How to offset particles from point of origin

Hi I'm having troubles off setting particles from a point of origin. I want my particles to spread out after a certain radius from a the point of origin. For example, this is what I have right now:

All particles emitted from a point of origin. What I want is this:

Particles are offset from the point of origin by some amount, i.e after the circle. What is the best way to achieve this? At the moment, I have the point of origin, the position of each particle and its rotation angle. Sorry for the poor illustrations.

Edit: I was mistaken, when a particle is created, I have only the point of origin. When the particle is created I am able to calculate the rotation of the particle in the update method after it has moved to a new location using atan2() method.

This is how I create/manage particles: Created new particle at enemy ship death location, for every new particle which is added to the list, call Update and Draw to update its position, calculate new angle and draw it.

First convert the angle to a normalized direction vector. You could try using the following method (taken from here). I think the order of the Sin and Cos and the signs might depend on how your angle is defined (e.g. what direction 0 represents), so play around with them if the result seems wrong:

Vector2 AngleToVector(float angle)
{
return new Vector2((float)Math.Sin(angle), -(float)Math.Cos(angle));
}


Then multiply it by the radius of the circle and add it to the point of origin to get the starting position of the particle. In other words:

Vector2 origin; // center of the circle

• @Sun If you already have a velocity vector pointing in the right direction, there's no need to calculate the angle! Simply replace AngleToVector(angle) above with Vector2.Normalize(velocity). – David Gouveia Sep 10 '12 at 12:00