{"id":72578,"date":"2022-09-22T15:12:35","date_gmt":"2022-09-22T19:12:35","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=72578"},"modified":"2022-09-22T15:16:40","modified_gmt":"2022-09-22T19:16:40","slug":"rowing-boats","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/22\/rowing-boats\/","title":{"rendered":"Rowing boats"},"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>My string art uses loops to generate wave patterns to create an ocean. In the process, I am trying to control the lines carefully by adjusting the start and end points&rsquo; values.<\/p>\n\n\n\n<p><a class=\"p5_sketch_link\" data-width=\"300\" data-height=\"400\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/String-Art.js\" art><\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"300\" height=\"400\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Jason Jiang\n\/\/Section E\n\n\/\/Setting variables \nvar dx1;\nvar dy1;\nvar dx2;\nvar dy2;\nvar numLines = 10;\n\n\/\/Creating Sky\nfunction setup() {\n    createCanvas(300, 400);\n    background(135, 206, 235, 50);\n    }\n    \n\n\nfunction draw() {\n    \n    \/\/Waves\n    stroke(0, 100, 184);\n    var x1 = -30;\n    var y1 = 300;\n    var x2 = 600;\n    var y2 = 500;\n    strokeWeight(0);\n    line(-30, 300, -50, 400);\n    line(600, 300, 400, 500);\n    strokeWeight(1);\n    dx1 = (-50-(-30))\/numLines;\n    dy1 = (400-300)\/numLines;\n    dx2 = (600-300)\/numLines;\n    dy2 = -(500-300)\/numLines;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        strokeWeight(i*0.1)\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    }\n    \n\n    x1 = 0;\n    y1 = 300;\n    x2 = 500;\n    y2 = 500;\n    strokeWeight(0);\n    line(0, 300, -50, 400);\n    line(400, 150, 500, 500);\n    strokeWeight(1);\n    dx1 = (-50-0)\/+numLines;\n    dy1 = (400-300)\/numLines;\n    dx2 = (500-400)\/numLines;\n    dy2 = -(500-150)\/numLines;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        strokeWeight(i*0.1)\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    }\n\n\n    x1 = -100;\n    y1 = 300;\n    x2 = 400;\n    y2 = 300;\n    strokeWeight(0);\n    line(-100, 300, -250, 500);\n    line(300, 200, 400, 300);\n    strokeWeight(1)\n    dx1 = (-150+50)\/+numLines;\n    dy1 = (500-300)\/numLines;\n    dx2 = -(500-400)\/numLines;\n    dy2 = -(300-200)\/numLines;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        strokeWeight((numLines-i)*0.1)\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    \n    }\n\n\n    x1 = -100;\n    y1 = 300;\n    x2 = 400;\n    y2 = 320;\n    strokeWeight(0);\n    line(-100, 320, -350, 450);\n    line(200, 350, 150, 320);\n    strokeWeight(1)\n    dx1 = (-250-150)\/+numLines;\n    dy1 = (450-250)\/numLines;\n    dx2 = -(350-300)\/numLines;\n    dy2 = -(400-350)\/numLines;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        strokeWeight((numLines-i)*0.1)\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    \n    }\n    \n\n    x1 = -150;\n    y1 = 200;\n    x2 = 350;\n    y2 = 350;\n    strokeWeight(0);\n    line(-150, 200, -250, 400);\n    line(300, 300, 350, 350);\n    strokeWeight(1)\n    dx1 = (-250+100)\/+numLines;\n    dy1 = (300-100)\/numLines;\n    dx2 = -(500-400)\/numLines;\n    dy2 = -(300-200)\/numLines;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        strokeWeight((numLines-i)*0.05)\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    \n    }\n    \n\n    \/\/Boat\n    \/\/Lower Part\n    x1 = 85;\n    y1 = 260;\n    x2 = 130;\n    y2 = 270;\n    strokeWeight(0);\n    line(85, 260, 90, 272);\n    line(130, 270, 120, 280);\n    strokeWeight(1)\n    dx1 = 2*(90-85)\/numLines;\n    dy1 = 2*(272-260)\/numLines;\n    dx2 = 2*(120-130)\/numLines;\n    dy2 = 2*(280-270)\/numLines;\n    for (var i = 0; i &lt;= 0.5*numLines; i += 1) {\n        strokeWeight((numLines-i)*0.15)\n        stroke(i);\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    \n    }\n    \/\/Upper Part\n    x1 = 92;\n    y1 = 259;\n    x2 = 120;\n    y2 = 265;\n    strokeWeight(0);\n    line(92, 261, 110, 230);\n    line(120, 267, 110, 230);\n    strokeWeight(1)\n    dx1 = (110-92)\/numLines;\n    dy1 = (230-261)\/numLines;\n    dx2 = (110-120)\/numLines;\n    dy2 = (230-267)\/numLines;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        strokeWeight((numLines-i)*0.15)\n        stroke(i+100);\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    \n    }\n\n    \/\/Sun\n    x1 = 200;\n    y1 = 59;\n     \/\/Outer Ring\n     for (var i = 0; i &lt;= 10*numLines; i += 1) {\n        stroke(253, 184, 19, 50)\n        strokeWeight(1)\n        push()\n        translate(x1, y1);\n        rotate(radians(i*180\/numLines));\n        line(0, 0, 0, 100);\n        pop()\n \n    }\n    \/\/Inner Ring\n    for (var i = 0; i &lt;= 10*numLines; i += 1) {\n        stroke(200, 92, 60)\n        strokeWeight(1)\n        push()\n        translate(x1, y1);\n        rotate(radians(i*0.5*180\/numLines));\n        line(0, 0, 0, 50);\n        pop()\n    }\n\nnoLoop();\n\n}<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>My string art uses loops to generate wave patterns to create an ocean. In the process, I am trying to control the lines carefully by adjusting the start and end points&rsquo; values. \/\/Jason Jiang \/\/Section E \/\/Setting variables var dx1; var dy1; var dx2; var dy2; var numLines = 10; \/\/Creating Sky function setup() { &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/22\/rowing-boats\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Rowing boats&#8221;<\/span><\/a><\/p>\n","protected":false},"author":723,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,121],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72578"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/723"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=72578"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72578\/revisions"}],"predecessor-version":[{"id":72585,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72578\/revisions\/72585"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=72578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=72578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=72578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}