{"id":5462,"date":"2018-03-29T08:15:05","date_gmt":"2018-03-29T12:15:05","guid":{"rendered":"https:\/\/blogs.mathworks.com\/community\/?p=5462"},"modified":"2018-03-28T13:47:22","modified_gmt":"2018-03-28T17:47:22","slug":"jiris-ovozoetrope","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2018\/03\/29\/jiris-ovozoetrope\/","title":{"rendered":"Ji\u0159\u00ed&#8217;s Ovozoetrope"},"content":{"rendered":"<p>We have a treat today: a guest visit from MATLAB user and controls researcher <a href=\"http:\/\/aa4cc.dce.fel.cvut.cz\/users\/jirizemanek\">Ji\u0159\u00ed Zem\u00e1nek<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"250\" height=\"251\" class=\"alignnone size-full wp-image-5480\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/jiri-e1522185201226.jpg\" alt=\"\" \/><\/p>\n<p>Ji\u0159\u00ed\u00a0is a doctoral student at the\u00a0Czech Technical University in Prague. He also likes eggs. But first, consider this spiral pattern.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"274\" height=\"260\" class=\"alignnone size-full wp-image-5466\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spiral-1.png\" alt=\"\" \/><\/p>\n<p>Now spin it around. At this rate of rotation, your eye follows the spinning pattern as a whole. Like any image on a turn table, it&#8217;s just turning in place.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"279\" height=\"263\" class=\"alignnone size-full wp-image-5468\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/archimedes3.gif\" alt=\"\" \/><\/p>\n<p>But if we spin it somewhat faster (that is, rotate it through a larger angle between frames), something interesting happens. The dots now move in such a way that it looks like an animation of individual dots moving on their own. Blue dots are being sprayed from the center in a sprinkler pattern. It&#8217;s the <em>same pattern<\/em>, but at a particular stroboscopic frequency your perception of what&#8217;s happening changes dramatically. This is the basic idea behind a zoetrope, which <a href=\"https:\/\/blogs.mathworks.com\/community\/2017\/09\/13\/a-galloping-logo-zoetrope\/\">you may recall from a post last year<\/a>.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"279\" height=\"263\" class=\"alignnone size-full wp-image-5470\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/archimedes1.gif\" alt=\"\" \/><\/p>\n<p>That brings us back to Ji\u0159\u00ed. By day, Ji\u0159\u00ed builds control systems for manipulation using electric and magnetic fields (check out the <a href=\"https:\/\/www.youtube.com\/watch?v=AhS_2gU1qW0\">awesome Magman project<\/a> from a few years ago). But by night, Ji\u0159\u00ed becomes a brilliant egg-obsessed animator. Okay, that might be a slight exaggeration (orange you glad I didn&#8217;t say eggsaggeration?), but Ji\u0159\u00ed has used his MATLAB chops to design zoetrope-able patterns on the sides of eggs. To transfer the images to the egg, he used an <a href=\"https:\/\/shop.evilmadscientist.com\/productsmenu\/768\">Eggbot from Evil Mad Scientist Laboratories<\/a>. Then he takes them for a spin. Rotate the eggs around at exactly the right speed (and use a strobing shutter) and the designs spring to life.<\/p>\n<p>Czech out his video. I mean, check out his video (sorry, I couldn&#8217;t resist).<\/p>\n<p><iframe loading=\"lazy\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/JfajQ4_hSN0?feature=oembed\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/p>\n<p>Amazing, huh? I call it the Ovozoetrope.\u00a0Ji\u0159\u00ed calls it Eggstatic.<\/p>\n<p>I asked Ji\u0159\u00ed if he could share any of his pattern-generating MATLAB code with us. He said it&#8217;s not available in a convenient form yet, but he may make an egg animation tutorial sometime soon. In the meantime, I noticed that he said he was inspired by patterns from phyllotaxis. This encouraged me to try an example of my own.<\/p>\n<p>Phyllotaxis is a fancy Greek word for describing how seeds or leaves arrange themselves as they grow. You may know that the seeds in a sunflower (among other plants) are laid down along a Fermat spiral (r = \u221a\u03b8), with one seed dropping every 137.5 degrees. That&#8217;s the Golden Angle for you fans of Phi. This arrangement lets some very simple growth rules optimize the seed packing as the plant grows.<\/p>\n<pre style=\"padding-left: 30px;\">phi = (sqrt(5)+1)\/2;\r\ngolden_angle = 2*pi\/phi;\r\nmax_angle = 1000;\r\ntheta = 1:golden_angle:max_angle;\r\nr = sqrt(theta);\r\n[x,y] = pol2cart(theta,r);\r\nplot(x,y,'.')<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"316\" height=\"294\" class=\"alignnone size-full wp-image-5472\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/sunflower.png\" alt=\"\" \/><\/p>\n<p>Phyllotaxis patterns are ideal for zoetropic animation. I took this pattern and animated it. The result gives you a visceral sense of how the seeds come into existence at the center of the flower and slowly radiate outward. Amazingly, there are only 11 frames in this animation.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"301\" height=\"307\" class=\"alignnone size-full wp-image-5474\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/ovozoetrope14.gif\" alt=\"\" \/><\/p>\n<p>My version is not on an egg, but it could be. The idea is the same. Maybe Ji\u0159\u00ed can do a seed-packing egg animation one of these days.<\/p>\n<p>So if you celebrate Easter, then Happy Easter! If you don&#8217;t, then Happy Check-Out-These-Amazing-Zoetropic-Eggs!<\/p>\n<p><iframe loading=\"lazy\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/rIgpqlrj-G0?feature=oembed\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/jiri-e1522185201226.jpg\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>We have a treat today: a guest visit from MATLAB user and controls researcher Ji\u0159\u00ed Zem\u00e1nek.<\/p>\n<p>Ji\u0159\u00ed\u00a0is a doctoral student at the\u00a0Czech Technical University in Prague. He also likes eggs. But first,&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2018\/03\/29\/jiris-ovozoetrope\/\">read more >><\/a><\/p>\n","protected":false},"author":69,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[256],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/5462"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/69"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=5462"}],"version-history":[{"count":9,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/5462\/revisions"}],"predecessor-version":[{"id":5492,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/5462\/revisions\/5492"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=5462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=5462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=5462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}