{"id":254,"date":"2009-04-15T18:35:09","date_gmt":"2009-04-16T01:35:09","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=1171"},"modified":"2009-04-15T18:35:09","modified_gmt":"2009-04-16T01:35:09","slug":"plot-of-sinh","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=254","title":{"rendered":"Plot of sinh()"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nx = stage.stageWidth \/ 2;\r\ny = stage.stageHeight \/ 2;\r\nscaleX = scaleY = 3;\r\n\r\nvar t:Number =-5;\r\nvar xp:Number = 0;\r\nvar yp:Number = 0;\r\n  \r\naddEventListener(Event.ENTER_FRAME, onLoop);\r\nfunction onLoop(evt:Event):void {\r\n\t xp = t;\r\n\t yp = sinh(t);\r\n\t \r\n\tgraphics.lineStyle(0,0);\r\n\tif (t == -5){\r\n\t\tgraphics.moveTo(xp, yp);\r\n\t}else{\r\n\t    graphics.lineTo(xp, yp);\r\n\t}\r\n\t if (t &gt; 5){\r\n\t\t removeEventListener(Event.ENTER_FRAME, onLoop);\r\n\t }\r\n\t t+=.2;\r\n}\r\nfunction sinh(x:Number):Number{\r\n\treturn (Math.pow(Math.E, x) - Math.pow(Math.E, -x)) * 0.5;\r\n}\r\n<\/pre>\n<p>Just a quick plot to test the sinh() function from a few days ago&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>x = stage.stageWidth \/ 2; y = stage.stageHeight \/ 2; scaleX = scaleY = 3; var t:Number =-5; var xp:Number = 0; var yp:Number = 0; addEventListener(Event.ENTER_FRAME, onLoop); function onLoop(evt:Event):void { xp = t; yp = sinh(t); graphics.lineStyle(0,0); if (t == -5){ graphics.moveTo(xp, yp); }else{ graphics.lineTo(xp, yp); } if (t &gt; 5){ removeEventListener(Event.ENTER_FRAME, onLoop); } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121],"tags":[3,4],"class_list":["post-254","post","type-post","status-publish","format-standard","hentry","category-math","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/254","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=254"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/254\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}