{"id":513,"date":"2012-11-12T15:04:26","date_gmt":"2012-11-12T15:04:26","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=513"},"modified":"2012-11-12T15:08:13","modified_gmt":"2012-11-12T15:08:13","slug":"eclipse","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/eclipse\/","title":{"rendered":"Eclipse"},"content":{"rendered":"<p>I initially tried animating shooting stars, but I was not able to have legit results.  I was then inspired by the marvelous view of an eclipse.  <\/p>\n<p><script type=\"application\/processing\">\r\nfloat time = 0.0;\r\nfloat increment = 0.01;\r\n\r\n\r\nvoid setup()\r\n{\r\n  size (800,800);\r\n  smooth();\r\n  background (162);\r\n  noLoop();\r\n\r\n  fill(219, 214, 71);\r\n  strokeWeight (5);\r\n  stroke (255, 5);\r\n}\r\n\r\nvoid draw ()\r\n{\r\n  background (5);\r\n\r\n  int dia = 200;\r\n\r\n  for (int i = 4000; i < 9000; i++)\r\n  {\r\n    strokeWeight (random (5, 8));\r\n    float angle1 = random (TWO_PI), angle2 = random (TWO_PI);\r\n    PVector p1 = new PVector (width\/2 + cos (angle1) * dia, height\/2 + sin (angle1) * dia);\r\n    PVector p2 = new PVector (width\/2 + cos (angle2) * dia, height\/2 + sin (angle2) * dia);\r\n\r\n    line (p1.x, p1.y, p2.x, p2.y);\r\n\r\n  }\r\n\r\n\r\n    \/\/ Get a noise value at \"time\" and scale it according to the window's width.\r\n    float n = noise(time)*width;\r\n\r\n    \r\n    time += increment;\r\n\r\n    \r\n    noStroke();\r\n    fill(0);\r\n    ellipse(350, 350, 350, 350);\r\n    \r\n}\r\n\r\n\r\n\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I initially tried animating shooting stars, but I was not able to have legit results. I was then inspired by the marvelous view of an eclipse.<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/513"}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=513"}],"version-history":[{"count":4,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/513\/revisions"}],"predecessor-version":[{"id":536,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/513\/revisions\/536"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}