{"id":500,"date":"2010-03-27T11:43:53","date_gmt":"2010-03-27T18:43:53","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2866"},"modified":"2010-03-27T11:43:53","modified_gmt":"2010-03-27T18:43:53","slug":"logistic-map-play","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=500","title":{"rendered":"Logistic Map Play"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar offX:Number = 100;\r\nvar offY:Number = 300;\r\nvar scalarX:Number = 6;\r\nvar scalarY:Number = 200;\r\naddEventListener(Event.ENTER_FRAME, onLoop);\r\nfunction onLoop(evt:Event):void{\r\n\tvar r:Number = mouseY \/ 100;\r\n\tvar xn:Number = (mouseX - 100) \/ 650;\r\n\tvar xn1:Number = 0;\r\n\tgraphics.clear();\r\n\tgraphics.lineStyle(0,0);\r\n\tfor (var i:int = 0; i&lt;100; i++){\r\n\t  xn1 = r * xn * (1 - xn);\r\n\t  xn = xn1;\r\n\t  if (i == 0){\r\n\t\tgraphics.moveTo(offX+i*scalarX,offY+xn1*scalarY);  \r\n\t  }else{\r\n\t\tgraphics.lineTo(offX+i*scalarX, offY+xn1*scalarY);\r\n\t  }\r\n\t}\r\n}\r\n<\/pre>\n<p>Whenever I can&#8217;t decide what kind of snippet to make, I simply go to wikipedia or mathworld for a bit and I always end up with something. I&#8217;ve messed with Logistic Maps before (when learning about strange attractors). This is a simple rendering where the x and y axis change the biotic potential (r) and the starting value for x.<\/p>\n<p><a href=\"http:\/\/mathworld.wolfram.com\/LogisticMap.html\" target=\"blank\">Here is the link I used for reference.<\/a><\/p>\n<p><a data-asruffle-linked=\"true\" href=\"http:\/\/www.actionsnippet.com\/swfs\/logistics_map.html\" target=\"blank\"><br \/>\nHave a look at the swf (just move your mouse around).<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/biotic.gif\" \/><\/a> <span class=\"asruffle-link\" data-swf=\"{&quot;url&quot;:&quot;https:\\\/\\\/actionsnippet.com\\\/swfs\\\/logistics_map.swf&quot;,&quot;title&quot;:&quot;logistics map&quot;,&quot;width&quot;:800,&quot;height&quot;:600,&quot;missing&quot;:false,&quot;allowScriptAccess&quot;:false,&quot;backgroundColor&quot;:&quot;#ffffff&quot;}\"><button type=\"button\" hidden aria-expanded=\"false\">Play demo<span class=\"screen-reader-text\">: logistics map<\/span><\/button><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>var offX:Number = 100; var offY:Number = 300; var scalarX:Number = 6; var scalarY:Number = 200; addEventListener(Event.ENTER_FRAME, onLoop); function onLoop(evt:Event):void{ var r:Number = mouseY \/ 100; var xn:Number = (mouseX &#8211; 100) \/ 650; var xn1:Number = 0; graphics.clear(); graphics.lineStyle(0,0); for (var i:int = 0; i&lt;100; i++){ xn1 = r * xn * (1 &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,121,94],"tags":[3,14,4],"class_list":["post-500","post","type-post","status-publish","format-standard","hentry","category-graphics","category-math","category-misc","tag-actionscript","tag-as3","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=500"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/500\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}