{"id":6162,"date":"2015-08-28T09:00:03","date_gmt":"2015-08-28T13:00:03","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=6162"},"modified":"2015-08-25T10:57:30","modified_gmt":"2015-08-25T14:57:30","slug":"dancing-megan","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2015\/08\/28\/dancing-megan\/","title":{"rendered":"Dancing Megan"},"content":{"rendered":"\r\n\r\n<div class=\"content\"><p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51139-megan-simulator--xkcd-\">Megan Simulator (XKCD)<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/1379371\">Alfonso Nieto-Castanon<\/a>.<\/p><p>Some of you may know Alfonso from <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/cody\/\">Cody<\/a>. He is currently ranked number one based on <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/cody\/players?term=&amp;sort=score+desc\">score<\/a>, <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/cody\/players?term=&amp;sort=solved+desc\">problems solved<\/a>, and <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/cody\/players?term=&amp;sort=badges+desc\">number of badges<\/a>. Not only is he super talented in Cody, he has created a well-written, fun-to-watch entry. Oh and by the way, he is also very active in MATLAB-related contests, as you can see here in the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/contest\/hall_of_fame.html\">MATLAB Contest Hall of Fame<\/a> and the <a href=\"https:\/\/www.kaggle.com\/c\/packing-santas-sleigh\/details\/winners\">\"Packing Santa's Sleigh\" Kaggle contest<\/a>.<\/p><p>Many MATLAB-ers may know of <a href=\"http:\/\/xkcd.com\/\">xkcd<\/a>. Alfonso has created a simulator for one of the stick figure characters, Megan. Not only are the details of the graphics superb, the stick figure movements adhere to physics-based rules. For example, while the character can jump, when the foot is on the ground, she pivots over the foot. Megan's hair also flows based on the movement.<\/p><p>It's difficult to describe all the details, so let's take a look.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_megan\/megan.gif\" alt=\"\"> <\/p><p>Pretty cool, huh? There are many other features, such as being able to select the terrain and creating videos or snapshots.<\/p><p><b>Comments<\/b><\/p><p>Download the file, try it, and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=6162#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51139-megan-simulator--xkcd-#comments\">comment<\/a> for Alfonso.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_f9f21505207a4967bb87588fe589cf3e() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='f9f21505207a4967bb87588fe589cf3e ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' f9f21505207a4967bb87588fe589cf3e';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2015 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_f9f21505207a4967bb87588fe589cf3e()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2015a<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2015a<br><\/p><\/div><!--\r\nf9f21505207a4967bb87588fe589cf3e ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\r\n% Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51139-megan-simulator--xkcd- Megan\r\n% Simulator (XKCD)> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/1379371 Alfonso\r\n% Nieto-Castanon>.\r\n%\r\n% Some of you may know Alfonso from\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/cody\/ Cody>. He is currently\r\n% ranked number one based on\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/cody\/players?term=&sort=score+desc\r\n% score>,\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/cody\/players?term=&sort=solved+desc\r\n% problems solved>, and\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/cody\/players?term=&sort=badges+desc\r\n% number of badges>. Not only is he super talented in Cody, he has created\r\n% a well-written, fun-to-watch entry. Oh and by the way, he is also very\r\n% active in MATLAB-related contests, as you can see here in the\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/contest\/hall_of_fame.html MATLAB\r\n% Contest Hall of Fame> and the\r\n% <https:\/\/www.kaggle.com\/c\/packing-santas-sleigh\/details\/winners \"Packing\r\n% Santa's Sleigh\" Kaggle contest>.\r\n%\r\n% Many MATLAB-ers may know of <http:\/\/xkcd.com\/ xkcd>. Alfonso has created\r\n% a simulator for one of the stick figure characters, Megan. Not only are\r\n% the details of the graphics superb, the stick figure movements adhere to\r\n% physics-based rules. For example, while the character can jump, when the\r\n% foot is on the ground, she pivots over the foot. Megan's hair also flows\r\n% based on the movement.\r\n%\r\n% It's difficult to describe all the details, so let's take a look.\r\n%\r\n% <<megan.gif>>\r\n% \r\n% Pretty cool, huh? There are many other features, such as being able to\r\n% select the terrain and creating videos or snapshots.\r\n%\r\n% *Comments*\r\n%\r\n% Download the file, try it, and let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=6162#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51139-megan-simulator--xkcd-#comments\r\n% comment> for Alfonso.\r\n\r\n##### SOURCE END ##### f9f21505207a4967bb87588fe589cf3e\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_megan\/megan.gif\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\n\r\nJiro's pick this week is Megan Simulator (XKCD) by Alfonso Nieto-Castanon.Some of you may know Alfonso from Cody. He is currently ranked number one based on score, problems solved, and number of... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2015\/08\/28\/dancing-megan\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6162"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=6162"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6162\/revisions"}],"predecessor-version":[{"id":6167,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6162\/revisions\/6167"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=6162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=6162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=6162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}