Calculating that amount of pixels will be slow because HTML5Canvas 2D is not very performant, you could use WEBGL to speed things up. or just use a smaller canvas then resize it with CSS. that would be a good choice.
You can watch Daniel Shiffman's tutorials about repelling, steering behaviors & vectors to understand the physics behind it. here's a video youtube.com/watch?v=4hA7G3gup-4
Calculating that amount of pixels will be slow because HTML5Canvas 2D is not very performant, you could use WEBGL to speed things up. or just use a smaller canvas then resize it with CSS. that would be a good choice.
You can watch Daniel Shiffman's tutorials about repelling, steering behaviors & vectors to understand the physics behind it. here's a video youtube.com/watch?v=4hA7G3gup-4
Also try my demo here (source-code)
another one here (source-code)