Rewrote to use Vector2 and to assume that particles have a position property instead of individual x y properties.
Merge remote-tracking branch 'origin/master'