{"id":66385,"date":"2021-09-25T16:05:18","date_gmt":"2021-09-25T20:05:18","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=66385"},"modified":"2021-09-25T16:05:18","modified_gmt":"2021-09-25T20:05:18","slug":"random-lines-spin-art","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/25\/random-lines-spin-art\/","title":{"rendered":"Random Lines Spin Art"},"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>I spent a good amount of time trying to decide what to make. I ended up moving certain variables to fit between my triangular sides to make a star or compass shape. To keep it more simple for myself to move between to points I made it so I was not changing all of the line points. I think this helped a lot to understand the movement of the lines better. I tried to condense my code as much as I could.<\/p>\n\n\n\n<p><a class=\"p5_sketch_link\" data-width=\"400\" data-height=\"400\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/sketch-167.js\">file<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"400\" height=\"400\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">var dx1; \/\/variables for each triangle 1= triangle 1, 2= triangle 2\nvar dy1;\nvar dy2;\nvar dx3;\nvar dy3;\nvar dx4;\nvar numLines = 35;\nfunction setup() {\n    createCanvas(400, 400);\n    background(200);\n    dx1 = (100 - 50) \/ numLines; \/\/x2-x1\/number of lines(thick or thin)\n    dy1 = (300 - 100) \/ numLines; \/\/makes line lenght shorter or longer(higher,lower)\n    dy2 = (100 - 300) \/ numLines; \/\/some of the movement could stay the same or be switched\n    dx3 = (250 - 50) \/ numLines;\n    dy3 = (100 - 150) \/ numLines;\n    dx4 = (50 - 250) \/ numLines;\n}\n    \nfunction draw() { \/\/per 1 line stroke\n    strokeWeight(.5);\n    var x1 = 200; \/\/variables for each line, every triangle has 2\n    var y1 = 0; \/\/must have different variables or will not run correctly\n    var x2 = 150;\/\/even if numbers are the same\n    var y2 = 200;\n    var x3 = 200;\n    var y3 = 400;\n    var x4 = 150;\n    var y4 = 200;\n    var x5 = 0;\n    var y5 = 200;\n    var x6 = 200;\n    var y6 = 250;\n    var x7 = 200;\n    var y7 = 250;\n    var x8 = 400; \n    var y8 = 200;\n\n    for (var i = 0; i &lt;= numLines; i += 1) { \n        line(x1, y1, 150, 200); \/\/top tri, left line\n        x1 += dx1;\n        y1 += dy1;\n        line(x2, y2, 250, 200); \/\/top tri right line\n        x2 += dx1;\n        y2 += dy2;\n        line(x3, y3, 150, 200); \/\/bottom tri, left line\n        x3 += dx1;\n        y3 += dy2;\n        line(x4, y4, 250, 200); \/\/bottom tri right line\n        x4 += dx1;\n        y4 += dy1;\n        line(x5, y5, 200, 250); \/\/left tri, bottom line\n        x5 += dx3;\n        y5 += dy3;\n        line(x6, y6, 200, 150); \/\/right tri, top line\n        x6 += dx3;\n        y6 += dy3;\n        line(x7, y7, 200, 150); \/\/left tri, top line\n        x7 += dx4;\n        y7 += dy3;\n        line(x8, y8, 200, 250); \/\/right middle tri, bottom line\n        x8 += dx4;\n        y8 += dy3;\n    }\n    noLoop();\n }   <\/code><\/pre><\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-3 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"640\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM-1024x640.png\" alt=\"\" data-id=\"66386\" data-full-url=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM.png\" data-link=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?attachment_id=66386\" class=\"wp-image-66386\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM-1024x640.png 1024w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM-300x188.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM-768x480.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM-1536x960.png 1536w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM-2048x1280.png 2048w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.10.27-PM-1200x750.png 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"640\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM-1024x640.png\" alt=\"\" data-id=\"66387\" data-full-url=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM.png\" data-link=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?attachment_id=66387\" class=\"wp-image-66387\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM-1024x640.png 1024w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM-300x188.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM-768x480.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM-1536x960.png 1536w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM-2048x1280.png 2048w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.30.38-PM-1200x750.png 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"640\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM-1024x640.png\" alt=\"\" data-id=\"66388\" data-full-url=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM.png\" data-link=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?attachment_id=66388\" class=\"wp-image-66388\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM-1024x640.png 1024w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM-300x188.png 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM-768x480.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM-1536x960.png 1536w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM-2048x1280.png 2048w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-9.31.24-PM-1200x750.png 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><\/figure><\/li><\/ul><figcaption class=\"blocks-gallery-caption\">To make\/ find my shape points I had to make some circles and lines first as a preliminary canvas<\/figcaption><\/figure><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I spent a good amount of time trying to decide what to make. I ended up moving certain variables to fit between my triangular sides to make a star or compass shape. To keep it more simple for myself to move between to points I made it so I was not changing all of the &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/09\/25\/random-lines-spin-art\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Random Lines Spin Art&#8221;<\/span><\/a><\/p>\n","protected":false},"author":660,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,58,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66385"}],"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\/660"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=66385"}],"version-history":[{"count":3,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66385\/revisions"}],"predecessor-version":[{"id":66393,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/66385\/revisions\/66393"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=66385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=66385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=66385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}