{"id":237,"date":"2009-03-30T08:39:11","date_gmt":"2009-03-30T15:39:11","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=1086"},"modified":"2009-03-30T08:39:11","modified_gmt":"2009-03-30T15:39:11","slug":"hippopede","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=237","title":{"rendered":"Hippopede"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nx=stage.stageWidth\/2;\r\ny=stage.stageHeight\/2;\r\nvar xp:Number = 0, yp:Number = 0;\r\nvar r:Number = 0, t:Number = 0;\r\nvar speed:Number=.1;\r\n\r\nvar range:Number=.2;\r\nvar b:Number = 20;\r\nvar a:Number = b * range;\r\nvar orbit:Number = 2 * Math.PI + speed;\r\n \r\ngraphics.lineStyle(0,0x000000);\r\n\r\naddEventListener(Event.ENTER_FRAME, onLoop);\r\nfunction onLoop(evt:Event):void {\r\n\tvar sin:Number=Math.sin(t);\r\n\tr =  Math.sqrt(4 * b * (a - b * (sin * sin)));\r\n\txp= r * Math.cos(t);\r\n\typ= r * sin;\r\n\t\r\n    if (t==0) {\r\n\t\tgraphics.moveTo(xp, yp);\r\n\t} else {\r\n\t\tgraphics.lineTo(xp, yp);\r\n\t}\r\n\r\n\tt += speed;\r\n\t\r\n\tif (t &gt; orbit) {\r\n\t\trange += .5;\r\n\t\ta= b * range;\r\n\t\tt= 0;\r\n\t}\r\n}\r\n<\/pre>\n<p>The above draws a <a href=\"http:\/\/mathworld.wolfram.com\/Hippopede.html\" target=\"blank\">Hippopede<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/hippopede.gif\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>x=stage.stageWidth\/2; y=stage.stageHeight\/2; var xp:Number = 0, yp:Number = 0; var r:Number = 0, t:Number = 0; var speed:Number=.1; var range:Number=.2; var b:Number = 20; var a:Number = b * range; var orbit:Number = 2 * Math.PI + speed; graphics.lineStyle(0,0&#215;000000); addEventListener(Event.ENTER_FRAME, onLoop); function onLoop(evt:Event):void { var sin:Number=Math.sin(t); r = Math.sqrt(4 * b * (a &#8211; b [&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,13],"tags":[3,4],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-graphics","category-math","category-motion","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/237","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=237"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}