Hacker News new | ask | show | jobs
Do snakes use math to create their patterns?
1 points by tobireif 4217 days ago
In order to generate a pattern, I played with dots and a sine function, and by accident found something which reminds me of snake skin patterns.

Snake skin photos: https://encrypted.google.com/search?q=snake+skin&tbm=isch

Generated pattern: (using JavaScript's Math.cos function):

https://twitter.com/TobiReif/status/538442870920085504

Do you know other simple ways of generating patterns which resemble animal patterns?

My pattern consists of sine data - here's a version with different i and x progress showing this: http://codepen.io/TobiReif/pen/KwdVLV

  This version
    i ++;
    x += canvas.height * 0.00254;
  vs this one:
    i += 0.5;
    x += canvas.height * 0.2;
Perhaps it could be that the snakes generate their patterns based on sine data as well?