Random walker with vector object (Lévy flight)
Hey everyone! After yesterday attempt to code random walker, I thought it would be a good idea to implement almost same thing but with vector object. As far as I know it’s common practice to use vectors to describe coordinates and speed of objects - and it turns to be a good idea in this little do-it-after-came-back-from-work project. Previous version of random walker is here
Take a look at it first, some explanation below:
Code for vector object is pretty simple - it describes coordinates on canvas:
I also needed some sort of random vector with set length - to describe next step of walker:
After that, I only needed to put start of line on previous point (initial vector), than plus random vector to it and draw a line. Super simple. Full code - on my GitHub