{"id":192,"date":"2015-06-18T05:56:43","date_gmt":"2015-06-18T01:56:43","guid":{"rendered":"http:\/\/courses.haigarmen.com\/creativecoding\/?p=192"},"modified":"2015-06-18T06:00:37","modified_gmt":"2015-06-18T02:00:37","slug":"exercise-38","status":"publish","type":"post","link":"https:\/\/courses.haigarmen.com\/creativecoding\/exercise-38\/","title":{"rendered":"Exercise 38"},"content":{"rendered":"<p>now we randomize the radius using the noise() function<\/p>\n<pre><code>\r\nsize(500,300);\r\nbackground(255);\r\nstrokeWeight(0.5);   \r\nsmooth();\r\n\r\nint centX = 250;\r\nint centY = 150;\r\n\r\nfloat x, y;\r\nfor (int i = 0; i<100; i++) {    \r\n  float lastx = -999;\r\n  float lasty = -999;\r\n  float radiusNoise = random(10);\r\n  float radius = 10;\r\n  stroke(random(20), random(50), random(70), 80); \r\n  int startangle = int(random(360)); \r\n  int endangle =  1440 + int(random(1440)); \r\n  int anglestep =  5 + int(random(3)); \r\n  for (float ang = startangle; ang <= 1440 + random(1440); ang += anglestep) {    \r\n    radiusNoise += 0.05;\r\n    radius += 0.5;\r\n    float thisRadius = radius + (noise(radiusNoise) * 200) - 100;\r\n    float rad = radians(ang);\r\n    x = centX + (thisRadius * cos(rad));\r\n    y = centY + (thisRadius * sin(rad));\r\n    if (lastx > -999) {\r\n      line(x,y,lastx,lasty);\r\n    }\r\n    lastx = x;\r\n    lasty = y;  \r\n  }\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>now we randomize the radius using the noise() function size(500,300); background(255); strokeWeight(0.5); smooth(); int centX = 250; int centY = 150; float x, y; for (int i = 0; i<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-lessons"],"_links":{"self":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":3,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/posts\/192\/revisions\/195"}],"wp:attachment":[{"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.haigarmen.com\/creativecoding\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}