{"id":541,"date":"2022-02-01T08:18:50","date_gmt":"2022-02-01T08:18:50","guid":{"rendered":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/?p=541"},"modified":"2022-02-01T08:19:09","modified_gmt":"2022-02-01T08:19:09","slug":"small-assignment-2-2","status":"publish","type":"post","link":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/2022\/02\/01\/small-assignment-2-2\/","title":{"rendered":"Small Assignment 2"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>Polar Plot<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For the polar plots, I wanted to make the process at least a little interactive. I&#8217;ve always thought polar roses were very cool, and it&#8217;s always a good time to play around with changing their parameters. I made this one fairly similar to what we did in class, but limited to n &lt;= 10 and with limited size. Additionally, each key press changes the color of the shape fill to a nice flowery color.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-7.png\" alt=\"\" class=\"wp-image-544\" width=\"312\" height=\"310\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-7.png 881w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-7-300x298.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-7-150x150.png 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-7-768x763.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-7-575x571.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-7-380x377.png 380w\" sizes=\"auto, (max-width: 312px) 100vw, 312px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-01-004531.png\" alt=\"\" class=\"wp-image-546\" width=\"314\" height=\"306\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-01-004531.png 877w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-01-004531-300x293.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-01-004531-768x750.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-01-004531-575x561.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Screenshot-2022-02-01-004531-380x371.png 380w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><\/figure><\/div>\n<\/div><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Centered Circle<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The centered circle was a good way to get into the geometry headspace. It was fairly simple to figure out the math needed. Using the radius passed in, we can just solve for the circumference and use that to find the step size as we iterate.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-9.png\" alt=\"\" class=\"wp-image-547\" width=\"314\" height=\"284\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-9.png 817w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-9-300x272.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-9-768x696.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-9-575x521.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-9-380x344.png 380w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Flower<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This flower was probably the most challenging part of this assignment. It was a bit frustrating knowing that I had studied these trigonometric identities in detail, but that I didn&#8217;t remember any of them or how to use them because of how long it has been. For the underlying math, I used the length\/radius to find the radius of the petal semicircle with the sin(theta) = opposite\/hypotenuse identity. Using that, I could get the step size for the semicircle to make an appropriately sized arc. Through trial and error, I found that dividing the petal angle by 2 gave the correct turn angle for the turtle. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, getting the math down was only a part of the equation, so to speak. The first mistake was forgetting to convert degrees to radians. I got a little mixed up because the turtle used degrees, but the math to get the semicircle radius did not. My second and most frustrating mistake was in assigning the internal angle degrees. I had the angle as a float type, but it kept giving gaps between the first and last petals for flowers with an odd number of petals. Apparently, you have to both assign the float and cast it while computing the decimal&#8230; <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-10.png\" alt=\"\" class=\"wp-image-548\" width=\"328\" height=\"301\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-10.png 865w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-10-300x275.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-10-768x705.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-10-575x528.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-10-380x349.png 380w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><figcaption>n = 8<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-11.png\" alt=\"\" class=\"wp-image-549\" width=\"330\" height=\"327\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-11.png 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-11-300x297.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-11-150x150.png 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-11-768x761.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-11-575x570.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-11-380x377.png 380w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><figcaption>n = 17<\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Turtles<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For the first turtle procedure, I made a little path that uses the mouse position to assign both the step length and the color of the stroke. I found that an angle of 300* gives this fun cube-looking shape. As I was playing around with it, the patterns reminded me of that one scene in Interstellar (no spoilers), so I decided to keep it at that angle.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-12.png\" alt=\"\" class=\"wp-image-550\" width=\"335\" height=\"292\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-12.png 893w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-12-300x262.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-12-768x672.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-12-575x503.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-12-380x332.png 380w\" sizes=\"auto, (max-width: 335px) 100vw, 335px\" \/><figcaption>Turtle 1<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The second turtle process is my favorite. I wanted to do a galaxy-type scene with stars and a swirling center. I used two turtles, one for the swirls and one for the stars. Letting the star turtle go wild and randomly place stars around the plot didn&#8217;t look great, so I limited those to be near the swirling part as it was being drawn out.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/stars.png\" alt=\"\" class=\"wp-image-552\" width=\"344\" height=\"312\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/stars.png 895w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/stars-300x272.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/stars-768x696.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/stars-575x521.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/stars-380x344.png 380w\" sizes=\"auto, (max-width: 344px) 100vw, 344px\" \/><figcaption>Turtle 2<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The third turtle process creates sun-looking shapes using math similar to the circle\/petal procedures above. A single shape will continue spiraling and growing until a mouse click starts a new one in a different area. Each click changes the direction of the spiral and the color of the stroke.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-13.png\" alt=\"\" class=\"wp-image-551\" width=\"336\" height=\"337\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-13.png 892w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-13-300x300.png 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-13-150x150.png 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-13-768x771.png 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-13-575x578.png 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/image-13-380x382.png 380w\" sizes=\"auto, (max-width: 336px) 100vw, 336px\" \/><figcaption>Turtle 3<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-be7f3522-3a6b-4dae-98ce-2f7e3bcf6f20\" href=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/JaminiSahuSA2.zip\">JaminiSahuSA2<\/a><a href=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/JaminiSahuSA2.zip\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-be7f3522-3a6b-4dae-98ce-2f7e3bcf6f20\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Polar Plot For the polar plots, I wanted to make the process at least a little interactive. I&#8217;ve always thought polar roses were very cool, and it&#8217;s always a good time to play around with changing their parameters. I made this one fairly similar to what we did in class, but limited to n &lt;= 10 and with limited size. [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,1],"tags":[],"class_list":["post-541","post","type-post","status-publish","format-standard","hentry","category-small-assignment-2","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts\/541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":2,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts\/541\/revisions"}],"predecessor-version":[{"id":661,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts\/541\/revisions\/661"}],"wp:attachment":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}