{"id":3758,"date":"2016-06-08T15:51:11","date_gmt":"2016-06-08T19:51:11","guid":{"rendered":"https:\/\/blogs.mathworks.com\/community\/?p=3758"},"modified":"2016-06-08T15:58:01","modified_gmt":"2016-06-08T19:58:01","slug":"national-jelly-filled-doughnut-day","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2016\/06\/08\/national-jelly-filled-doughnut-day\/","title":{"rendered":"National Jelly-Filled Doughnut Day"},"content":{"rendered":"<p>National Doughnut Day was June 3rd. On that day, <a href=\"https:\/\/twitter.com\/BikeMath\">Sean Breckling<\/a> was nice enough to tweet this to the universe of MATLAB users:<\/p>\n<p> <a href=\"https:\/\/twitter.com\/BikeMath\/status\/738818666448314369\">https:\/\/twitter.com\/BikeMath\/status\/738818666448314369<\/a><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"400\" height=\"474\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/doughnut_day_1.png\" alt=\"doughnut_day_1\" class=\"alignnone size-full wp-image-3759\" \/><br \/>\nI sampled his code (below) and found it delicious, although it had a slight metallic taste (note the copper colormap).<\/p>\n<pre id=\"matlabcode\" class=\"matlab-code\" style=\"background-color: #f7f7f7; font-family: monospace; font-weight: normal; padding-top: 5px; padding-bottom: 5px; line-height: 150%; border: 1px solid #E9E9E9;\">    X = imread(<span style=\"color: #a020f0;\">'sprinkles.jpg'<\/span>);\r\n    t = 0:0.01:1;\r\n    nt = max(size(t));\r\n           \r\n    outside = 2 + sqrt(1 - t.*t);\r\n    inside = 2 - sqrt(1 - t.*t);\r\n    \r\n    [x,y,z] = cylinder(outside);\r\n    [xx,yy,zz] = cylinder(inside);\r\n    \r\n    surf(x,y,z,    <span style=\"color: #a020f0;\">'LineStyle'<\/span>, <span style=\"color: #a020f0;\">'none'<\/span>, <span style=\"color: #a020f0;\">'FaceColor'<\/span>, <span style=\"color: #a020f0;\">'texturemap'<\/span>,<span style=\"color: #a020f0;\">'EdgeColor'<\/span>,<span style=\"color: #a020f0;\">'none'<\/span>);\r\n    hold <span style=\"color: #a020f0;\">on<\/span>\r\n    surf(x,y,-z,   <span style=\"color: #a020f0;\">'LineStyle'<\/span>, <span style=\"color: #a020f0;\">'none'<\/span>, <span style=\"color: #a020f0;\">'FaceColor'<\/span>, <span style=\"color: #a020f0;\">'texturemap'<\/span>,<span style=\"color: #a020f0;\">'EdgeColor'<\/span>,<span style=\"color: #a020f0;\">'none'<\/span>);\r\n    surf(xx,yy,zz, <span style=\"color: #a020f0;\">'LineStyle'<\/span>, <span style=\"color: #a020f0;\">'none'<\/span>, <span style=\"color: #a020f0;\">'FaceColor'<\/span>, <span style=\"color: #a020f0;\">'texturemap'<\/span>,<span style=\"color: #a020f0;\">'EdgeColor'<\/span>,<span style=\"color: #a020f0;\">'none'<\/span>);\r\n    surf(xx,yy,-zz,<span style=\"color: #a020f0;\">'LineStyle'<\/span>, <span style=\"color: #a020f0;\">'none'<\/span>, <span style=\"color: #a020f0;\">'FaceColor'<\/span>, <span style=\"color: #a020f0;\">'texturemap'<\/span>,<span style=\"color: #a020f0;\">'EdgeColor'<\/span>,<span style=\"color: #a020f0;\">'none'<\/span>);\r\n    axis <span style=\"color: #a020f0;\">tight<\/span> <span style=\"color: #a020f0;\">equal<\/span> <span style=\"color: #a020f0;\">off<\/span>;\r\n    colormap(<span style=\"color: #a020f0;\">'copper'<\/span>);\r\n    warp(x,y,z,X)\r\n    warp(xx,yy,zz,X)\r\n    hold <span style=\"color: #a020f0;\">off<\/span>\r\n<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"560\" height=\"420\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/doughnut_day_2.png\" alt=\"doughnut_day_2\" class=\"alignnone size-full wp-image-3760\" \/><\/p>\n<p>Sorry it took me a while to notice your tweet, Sean. I may be too late to wish you a Happy National Doughnut Day, but by a<br \/>\nfortunate coincidence, today is National Jelly-Filled Doughnut Day (strange but true!). So Happy National Jelly-Filled Doughnut<br \/>\nDay!<\/p>\n<p>In honor of this occasion, here is a doughnut-themed Cody problem: <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/cody\/problems\/502-would-homer-like-it\">Would Homer Like It?<\/a><\/p>\n<p>And finally, through the magic of spherical coordinates, we&#8217;ll close with a gratuitous animation. Because doughnut. Mmmm&#8230; doughnut.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"202\" height=\"154\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/doughnut_day_3.gif\" alt=\"doughnut_day_3\" class=\"alignnone size-full wp-image-3761\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/doughnut_day_1.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>National Doughnut Day was June 3rd. On that day, Sean Breckling was nice enough to tweet this to the universe of MATLAB users:<br \/>\n https:\/\/twitter.com\/BikeMath\/status\/738818666448314369<\/p>\n<p>I sampled his&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2016\/06\/08\/national-jelly-filled-doughnut-day\/\">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":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/3758"}],"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=3758"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/3758\/revisions"}],"predecessor-version":[{"id":3767,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/3758\/revisions\/3767"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=3758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=3758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=3758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}