(Pseudo?)code:
void explode(nPoints){ dTheta = 2*PI/nPoints; R = rotationMatrix2d(dTheta); Vector2d p(1, 0); for(int i=0; i < nPoints; ++i) { createExplosionParticleAtPoint(p); p = R*p; // '*' here is overloaded to do matrix multiplication }}
where
[ cos(θ) -sin(θ) ]rotationMatrix2d(θ) = [ ] . [ sin(θ) cos(θ) ]
This kind of approach in other situations opens you up to nasty rounding problems, but given the number of particles per circle (< a few hundred, I'm guessing), the accuracy of the data types (floats I'm guessing; maybe doubles), and the purpose (graphics -- to look good) these won't accumulate fast enough to matter,
[Edited by - Emergent on December 2, 2009 7:29:38 PM]