How would I make spray patterns like CS:GO?

I’ve tried searching up how it works but I couldn’t find it anywhere.

Just so you know what im aiming for here is an example,

I tried doing something like a certain angle for every shot until 11 and then loop the last shots but that seemed like a bad idea and didn’t work well.