{"id":67808,"date":"2021-10-16T22:49:47","date_gmt":"2021-10-17T02:49:47","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=67808"},"modified":"2021-10-16T22:49:47","modified_gmt":"2021-10-17T02:49:47","slug":"project-curve-with-composition","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/16\/project-curve-with-composition\/","title":{"rendered":"Project: Curve with Composition"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p><a class=\"p5_sketch_link\" data-width=\"480\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-109.js\">luca curve<\/a><a><\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"480\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/lucacao\n\/\/section D\n\nvar np = 200;\n\n\nfunction setup() {\n    createCanvas(480, 480);\n}\n\nfunction draw() {\n    background(127, 222, 255);\n    stroke(229, 116, 188);\n    fill(229, 116, 188);\n   \n        push();\n        translate(120,120);\n        drawEightCurve();\n        pop();\/\/draw first shape\n\n        push();\n        translate(240,240);\n        drawEightCurve();\n        pop();\/\/draw second shape\n\n        push();\n        translate(360,360);\n        drawEightCurve();\n        pop();\/\/draw third shape\n\n        push();\n        translate(360,120);\n        drawEightCurve();\n        pop();\/\/draw fourth shape\n\n        push();\n        translate(120,360);\n        drawEightCurve();\n        pop();\/\/draw fifth shape\n\n}\n\nfunction drawEightCurve(){\n    var x;\n    var y;\n    var t;\n    var a = mouseX\/2;\n\n\n    beginShape();\n    for (var i = 0; i &lt; np; i++){\n        var t = map(i,0,np,0,TWO_PI);\n        x = a*(sin(t*5));\/\/x parametric\n        y = a*(sin(t*5))*cos(t*5);\/\/y parametric\n        vertex(x,y);\/\/draw shape\n    }\n    endShape();\n\n\n}\n<\/code><\/pre><\/p>\n\n\n\n<p>I found this project quite challenging because it requires an understanding of parametric functions, which I am not too familiar with. I watched some Khan Academy and learned the general features of the functions. I wanted to make my shapes change in size, so I used &ldquo;mouseX&rdquo; to control that. The function that I chose also creates a dynamic composition. Most of my process was actually changing around the variables and see what it does to the shapes. Overall, I am happy with the outcome. <\/p>\n\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>luca curve \/\/lucacao \/\/section D var np = 200; function setup() { createCanvas(480, 480); } function draw() { background(127, 222, 255); stroke(229, 116, 188); fill(229, 116, 188); push(); translate(120,120); drawEightCurve(); pop();\/\/draw first shape push(); translate(240,240); drawEightCurve(); pop();\/\/draw second shape push(); translate(360,360); drawEightCurve(); pop();\/\/draw third shape push(); translate(360,120); drawEightCurve(); pop();\/\/draw fourth shape push(); translate(120,360); drawEightCurve(); pop();\/\/draw &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/16\/project-curve-with-composition\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project: Curve with Composition&#8221;<\/span><\/a><\/p>\n","protected":false},"author":642,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67808"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/users\/642"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=67808"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67808\/revisions"}],"predecessor-version":[{"id":68504,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/67808\/revisions\/68504"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=67808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=67808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=67808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}