{"id":74146,"date":"2022-10-09T19:29:23","date_gmt":"2022-10-09T23:29:23","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=74146"},"modified":"2022-10-09T19:34:10","modified_gmt":"2022-10-09T23:34:10","slug":"project-6-abstract-clock-3","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/09\/project-6-abstract-clock-3\/","title":{"rendered":"Project 6 &#8211; Abstract Clock"},"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>Before we had clocks, we looked to the skies and celestial bodies above to tell time and orientation. For this project, I&rsquo;ve plotted a night sky with 12 different constellations that appear as the day progresses, with meteor showers occuring every 5 minutes.<\/p>\n\n\n\n<p>Basic Features:<br>&ndash; Stars that twinkle randomly<br>&ndash; Background color based on time of day (lightens as day progresses)<br>&ndash; 12 different constellations (accurate to Northern Hemisphere in August)<br>&ndash; Every hour a new constellation appears<br>&ndash; Meteor showers or &lsquo;shooting stars&rsquo; that occur every 5 minutes to indicate the passing of 5 minutes<br><br>(Please note that in order to import the star data without using a csv (due to difficulties circumventing CORS policy) the first 495 lines of code are all star + constellation information.)<\/p>\n\n\n\n<div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/sketch-92.js\" data-width=\"480\" data-height=\"480\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/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\">\/\/ Name: Tsz Wing Clover Chau\n\/\/ Section: E \n\/\/ email: ctchau@andrew.cmu.edu\n\/\/ Project-06\n\n\n\nlet data = [   \/\/first constellation\n            [[[-81.30973247,    45.89753673, \"L\"],   \n              [-69.80657573,    27.25487531, \"L\"],\n              [-83.5701992,     13.59553656, \"L\"],\n              [-102.9353214,    33.81097102, \"M\"],\n              [-81.30973247,    45.89753673, \"L\"]],\n \n             [[-81.30973247,    45.89753673, \"L\"],\n              [-83.21194136,    57.57386131, \"M\"],\n              [-78.00737768,    70.19871847, \"M\"],\n              [-65.52047168,    90.38733495, \"M\"]],\n \n             [[-81.30973247,    45.89753673, \"L\"],\n              [-79.00179591,    58.28543518, \"S\"],\n              [-72.71622665,    66.82432172, \"M\"],\n              [-56.23603836,    80.84899719, \"M\"]],\n \n             [[-69.80657573,    27.25487531, \"L\"],\n              [-63.09108408,    24.45143041, \"M\"],\n              [-59.33124834,    12.51803871, \"S\"],\n              [-53.67504909,    9.38172277 , \"S\"]],\n \n             [[-69.80657573,    27.25487531, \"L\"],\n              [-70.35891151,     20.90153254, \"M\"],\n              [-70.22649991,     18.78294683, \"S\"],\n              [-58.83910175,     0.068773112, \"S\"],\n              [-51.8212866,     -0.549147718, \"S\"]],\n\n             [[-83.5701992,     13.59553656, \"L\"],\n              [-80.88006024,     5.718673925, \"S\"],\n              [-80.74322899,     2.504256586, \"M\"],\n              [-74.12860005,    -9.286504731, \"M\"],\n              [-63.76642979,    -8.872286463, \"M\"]]],\n\n             \/\/ second constellation\n            [[[39.01312993,   70.78430398,   \"L\"],\n              [47.35506114,   71.00498999,   \"L\"],\n              [49.34123524,   60.19137546,   \"L\"],\n              [43.77750399,   57.0099355 ,   \"M\"],\n              [42.04897812,   50.0771234 ,   \"L\"],\n              [40.28349003,   44.51583592,   \"M\"],\n              [43.01999656,   36.48286513,   \"M\"]],\n \n             [[43.77750399,   57.0099355 ,   \"M\"],\n              [39.01312993,   70.78430398,   \"L\"],\n              [33.53041101,   86.12662728,   \"M\"],\n              [30.9148731 ,   97.89654786,   \"M\"],\n              [41.18456465,   84.69474518,   \"M\"],\n              [50.58589777,   91.84811645,   \"M\"],\n              [51.67570523,   92.99241428,   \"M\"],\n              [53.03796456,   104.6533541,   \"S\"],\n              [55.49003134,   104.2719215,   \"S\"]],\n                 \n             [[85.42531527,   58.66254473,   \"S\"],\n              [82.46534439,   59.53708159,   \"M\"],\n              [58.44921701,   58.7298168 ,   \"M\"],\n              [65.24369563,   67.20609705,   \"M\"],\n              [71.43272565,   81.13141461,   \"M\"],\n              [68.6072989 ,   83.14957657,   \"S\"]],\n                 \n             [[49.34123524,   60.19137546,   \"L\"],\n              [58.44921701,   58.7298168 ,   \"M\"]],\n                 \n             [[41.18456465,   84.69474518,   \"M\"],\n              [47.35506114,   71.00498999,   \"L\"]],\n                 \n             [[85.42531527,   58.66254473,   \"S\"],\n              [82.46534439,   59.53708159,   \"M\"],\n              [58.44921701,   58.7298168 ,   \"M\"],\n              [65.24369563,   67.20609705,   \"M\"],\n              [71.43272565,   81.13141461,   \"M\"],\n              [68.6072989 ,   83.14957657,   \"S\"]]],\n \n             \/\/ third constellation\n            [[[1.458598798,   66.23616304,  \"L\"],\n              [2.352193916,   60.74930789,  \"S\"],\n              [4.368337719,   56.17211655,  \"S\"],\n              [9.653903905,   52.95718454,  \"S\"],\n              [16.19118114,   51.23449244,  \"L\"],\n              [15.10294121,   47.50814724,  \"M\"],\n              [8.564096444,   49.46980066,  \"S\"],\n              [9.653903905,   52.95718454,  \"S\"]]],\n            \n             \/\/ fourth constellation\n            [[[-6.590790179,   -83.80630313, \"L\"],\n              [-0.615323792,   -77.31080679, \"L\"],\n              [-5.71200542,    -76.35517899, \"L\"],\n              [-8.064704903,   -69.53493942, \"L\"],\n              [-13.86042784,   -71.60960823, \"S\"],\n              [-17.56801424,   -70.75267342, \"L\"],\n              [-21.50545029,   -72.71002812, \"S\"],\n              [-20.14209587,   -76.22259689, \"L\"],\n              [-6.590790179,   -83.80630313, \"L\"]],\n\n             [[-13.86042784,   -71.60960823, \"S\"],\n              [-20.14209587,   -76.22259689, \"L\"]],\n\n             [[-5.71200542,    -76.35517899, \"L\"],\n              [-6.590790179,   -83.80630313, \"L\"]],\n\n             [[-5.71200542,    -76.35517899, \"L\"],\n              [-6.590790179,   -83.80630313, \"L\"]],\n             \n             [[-8.064704903,   -69.53493942, \"L\"],\n              [-3.082627727,   -63.36904156, \"S\"]],\n \n             [[-17.56801424,   -70.75267342, \"L\"],\n              [-20.38617647,   -63.6192995,  \"S\"],\n              [-21.99497748,   -62.36800982, \"S\"],\n              [-25.96335333,   -57.61310903, \"S\"]],\n \n             [[-6.590790179,   -83.80630313, \"L\"],\n              [-5.114574435,   -87.96959846, \"M\"]],\n \n             [[-21.50545029,   -72.71002812, \"S\"],\n              [-31.81704138,   -67.75307637, \"S\"],\n              [-39.34651974,   -70.82585414, \"S\"],\n              [-41.38721948,   -71.52954371, \"S\"],\n              [-40.9202775,    -83.68265947, \"S\"],\n              [-41.1347843,    -84.75519348, \"S\"],\n              [-39.40063134,   -97.38439895, \"S\"],\n              [-27.41782088,   -102.2813735, \"S\"],\n              [-27.72946212,   -102.9794499, \"S\"]],\n \n             \n             [[-39.34651974,   -70.82585414, \"S\"],\n              [-28.01323318,   -94.69202961, \"S\"]],\n \n             [[-20.38617647,   -63.6192995,  \"S\"],\n              [-18.02660164,   -62.86852569, \"S\"]]],\n            \n             \/\/fifth constellation\n            [[[51.68313157, -74.59487497,    \"S\"],\n              [51.85688208, -71.58319946,    \"S\"],\n              [49.91857688, -50.48883666,    \"M\"],\n              [54.8517741 , -41.53970748,    \"M\"],\n              [66.68054428, -49.44026667,    \"M\"],\n              [64.1863709 , -65.64553098,    \"M\"]],\n\n           \n             [[49.91857688, -50.48883666,    \"M\"],\n              [66.68054428, -49.44026667,    \"M\"]]],\n\n              \/\/ sixth constellation\n              [[[-28.25049035,    21.90763427, \"L\"],\n              [-29.05237454 ,  -8.933976793, \"M\"],\n              [-30.05337011,   -21.79845264, \"L\"],\n              [-32.01340999 ,  -24.46854673, \"S\"],\n              [-38.51780667 ,  -32.31873544, \"S\"],\n              [-23.73184394 ,  -30.50911015, \"S\"],\n              [-15.83268968,   -18.49868084, \"M\"],\n              [-28.47445623,   -20.35135353, \"M\"],\n              [-6.246178612,    7.80368656 , \"L\"],\n              [-7.700470381,    9.046871459, \"S\"],\n              [-28.25049035,    21.90763427, \"L\"]],\n \n             [[-28.25049035,    21.90763427, \"L\"],\n              [-27.20862688,    15.00847228, \"L\"],\n              [-23.75429763,    7.316898561, \"M\"],\n              [-19.5234676,    -1.520496344, \"M\"]],\n \n \n             [[-42.86022433,    9.735155491, \"M\"],\n              [-35.20115034,    10.69366795, \"M\"],\n              [-27.20862688,    15.00847228, \"L\"],\n              [-18.11568352,    17.26722891, \"M\"],\n              [-13.08553401,    23.52012366, \"M\"],\n              [-10.87867391,    24.49114211, \"M\"]],\n \n             [[-15.83268968,   -18.49868084, \"M\"],\n              [-14.51018108 ,  -17.07162404, \"S\"]],\n \n             [[-23.73184394 ,  -30.50911015, \"S\"],\n              [-19.20732445 ,  -40.8800735,  \"S\"],\n              [-17.88320838 ,  -42.11591516, \"S\"]],\n \n             [[-8.005402526,    6.677783255, \"S\"],\n              [-10.13992754,    6.396307428, \"S\"],\n              [-11.87569514,    1.963063164, \"S\"]]],\n\n             \/\/seventh constellation\n            [[[60.54101784,   2.275816369, \"L\"],\n              [48.47102481,    6.48703491 , \"M\"],\n              [37.83395909,    9.664913466, \"M\"],\n              [37.21603826,    18.80131432, \"M\"],\n              [44.145579  ,    20.34611639, \"M\"],\n              [49.35376885,    12.40142   , \"S\"],\n              [60.54101784,    2.275816369, \"L\"]],\n\n             [[49.35376885,   12.40142   , \"S\"],\n              [49.08894564,    10.94489233, \"S\"]],\n\n             [[56.89016285,   -7.804902645, \"S\"],\n              [60.54101784,    2.275816369, \"L\"],\n              [66.91639149,    4.836863903, \"M\"]]],\n\n            \/\/eigth constellation\n            [[[61.03712532,   -23.51897245, \"M\"],\n              [76.2399394 ,   -17.85197365, \"M\"],\n              [87.20224289,   -16.41843998, \"M\"],\n              [98.36940576,   -2.089490027, \"M\"],\n              [108.4602156,   -5.991269825, \"M\"],\n              [109.69881  ,   20.01815869 , \"S\"],\n              [119.3328342,   23.67244373 , \"S\"]],\n             \n             [[65.55982628,  -32.94580699,  \"M\"],\n              [75.53156455,  -30.43924983,  \"M\"],\n              [98.62336421,  -31.35454998,  \"L\"],\n              [108.4602156,  -5.991269825,  \"M\"],\n              [116.0938088,   1.248421898,  \"S\"]],\n             \n             [[88.35446325,   6.729849457,  \"M\"],\n              [98.36940576,  -2.089490027,  \"M\"]],\n\n             [[76.2399394 ,   -17.85197365, \"M\"],\n              [75.53156455,  -30.43924983,  \"M\"]],\n\n             [[87.20224289,   -16.41843998, \"M\"],\n              [98.62336421,  -31.35454998,  \"L\"]]],\n            \n            \/\/ninth constellation\n            [[[-27.97036149,    97.86651501, \"S\"],\n              [-18.94048898,    94.12007854, \"S\"],\n              [-9.09408544 ,    98.29879614, \"S\"],\n              [-10.59327567,    108.0279711, \"S\"],\n              [-16.74127398,    119.7956241, \"S\"]]],\n\n            \/\/tenth constellation\n            [[[5.319571808 ,     15.27986704, \"S\"],\n              [2.225986467 ,     5.831577348, \"S\"],\n              [8.997290938 ,     6.071090008, \"S\"],\n              [11.07069217 ,     5.894303006, \"M\"],\n              [15.10868883 ,     0.099613614, \"S\"],\n              [12.50228334 ,    -7.032641486, \"M\"],\n              [8.481085936 ,    -5.839664643, \"S\"],\n              [4.56767671  ,    -4.368466998, \"M\"],\n              [2.171312707 ,    -2.838674937, \"S\"],\n              [-0.355196297,    -3.244706657, \"S\"]],\n                 \n              [[2.171312707, -2.838674937,  \"S\"],\n               [1.709621983, -1.653668745,  \"S\"]],\n                \n              [[26.18888289, 16.05781367 ,  \"S\"],\n               [22.33741325, 17.38990091 ,  \"S\"],\n               [19.76011401, 18.25865346 ,  \"S\"],\n               [18.39717201, 13.36557494 ,  \"S\"],\n               [17.32571053, 9.224521115 ,  \"M\"],\n               [19.39550622, 1.749250539 ,  \"M\"],\n               [24.48804677, -8.578746279,  \"M\"],\n               [26.93450093, -10.89496905,  \"M\"],\n               [27.19512669, -16.68665272,  \"M\"],\n               [25.66033052, -20.2774966 ,  \"M\"]],\n                \n              [[12.50228334, -7.032641486,  \"M\"],\n               [13.73443018, -18.42818892,  \"S\"],\n               [24.48804677, -8.578746279,  \"M\"]],\n                 \n              [[15.10868883, 0.099613614,   \"S\"],\n               [19.39550622, 1.749250539,   \"M\"]],\n                   \n              [[11.07069217, 5.894303006,   \"M\"],\n               [17.32571053, 9.224521115,   \"M\"]]],\n\n            \/\/ eleventh constellation\n            [[[12.6209419,     -76.17543312, \"M\"],\n              [14.31490933,    -68.88084874, \"M\"],\n              [12.81336171,    -67.87981699, \"M\"],\n              [14.8154252 ,    -63.08916507, \"M\"],\n              [6.204943095,    -29.96074626, \"M\"],\n              [8.275577271,    -20.3704406,  \"L\"],\n              [19.03382074,    -23.72757948, \"M\"],\n              [28.02080187,    -31.100746,   \"M\"],\n              [34.45008626,    -37.57453788, \"M\"]],\n \n             [[6.204943095,    -29.96074626, \"M\"],\n              [5.314500086,    -32.52363291, \"S\"],\n              [1.666573231,    -47.94643484, \"M\"]],   \n \n             [[-14.81981548,   -29.73185186, \"S\"],\n              [-4.719413958,   -39.09939645, \"M\"],\n              [7.351003499,    -51.95056182, \"S\"],\n              [8.924053384,    -55.20391499, \"M\"],\n              [14.03646551,    -51.87905955, \"S\"],\n              [17.70651702,    -55.28452075, \"L\"]],\n \n             [[17.70651702,    -55.28452075, \"L\"],\n              [28.15534601,    -47.71694618, \"L\"],\n              [33.53711124,    -39.03884973, \"M\"],\n              [34.45008626,    -37.57453788, \"M\"]],\n           \n \n             [[6.204943095,    -29.96074626, \"M\"],\n              [1.144487844,    -32.23404872, \"S\"],\n              [-0.129682563,   -32.90009235, \"S\"],\n              [0.941778916,    -34.00051224, \"S\"]],\n \n \n             [[19.03382074,    -23.72757948, \"M\"],\n              [19.93153171,    -22.45340907, \"S\"]]], \n            \n            \/\/ twelth constellation\n            [[[-44.13070076,  -47.56894476, \"S\"],\n              [-45.54745045,  -50.83836714, \"M\"],\n              [-49.22571716,  -54.74951485, \"S\"],\n              [-48.61759037,  -55.6182674 , \"S\"],\n              [-57.2778691 ,  -66.24946712, \"S\"],\n              [-60.10329585,  -68.26762909, \"S\"],\n              [-65.55710623,  -64.4554043 , \"S\"],\n              [-72.68365623,  -58.95743272, \"S\"],\n              [-73.28305034,  -57.26823116, \"S\"],\n              [-75.51715563,  -53.29043393, \"S\"],\n              [-78.73208764,  -46.15219506, \"M\"],\n              [-76.00756899,  -47.35098326, \"S\"],\n              [-68.43340714,  -49.53059819, \"S\"],\n              [-62.71191797,  -51.98266497, \"S\"],\n              [-44.13070076,  -47.56894476, \"S\"]]],\n\n            \/\/ single stars\n\n            [[[104.9886578 ,     52.44117013 ,   \"M\"],\n              [106.1322829 ,     32.59591081 ,   \"M\"],\n              [113.6667542 ,     47.59758141 ,   \"M\"],\n              [5.11024982  ,    -88.47011433 ,   \"M\"],\n              [88.41769489 ,    -64.89519854 ,   \"M\"],\n              [11.27889721 ,    -30.50408545 ,   \"M\"],\n              [-3.37534974 ,     67.12602697 ,   \"M\"],\n              [35.62895531 ,    -68.60804233 ,   \"M\"],\n              [40.36506015 ,    -59.2406066  ,   \"M\"],\n              [43.70513643 ,    -69.07280707 ,   \"M\"],\n              [42.7175803  ,    -63.12573704 ,   \"M\"],\n              [42.13375365 ,    -35.96420913 ,   \"M\"],\n              [39.80992995 ,    -25.98964281 ,   \"M\"],\n              [34.84245066 ,    -13.29661451 ,   \"M\"],\n              [35.94287055 ,     -9.676812218,   \"M\"],\n              [37.47766673 ,    -12.74640456 ,   \"M\"],\n              [42.60330677 ,    -17.49558517 ,   \"M\"],\n              [41.27916704 ,    -23.18270057 ,   \"M\"],\n              [-19.04817726,    -88.46549279 ,   \"S\"],\n              [-21.80293192,    -88.17308867 ,   \"S\"],\n              [-22.75709275,    -89.55816084 ,   \"S\"],\n              [-23.0636038 ,    -92.31056828 ,   \"S\"],\n              [-22.43683664,    -94.61454593 ,   \"S\"],\n              [-20.48514261,    -97.60750188 ,   \"S\"],\n              [-15.55931565,   -100.4457165  ,   \"S\"],\n              [-16.74127398,    119.7956241  ,   \"S\"],\n              [-10.59327567,    108.0279711  ,   \"S\"],\n              [-27.97036149,     97.86651501 ,   \"S\"],\n              [-18.94048898,     94.12007854 ,   \"S\"],\n              [-13.27280304,     86.72326807 ,   \"S\"],\n              [-9.09408544 ,     98.29879614 ,   \"S\"],\n              [-42.27589132,     -9.540592057,   \"S\"],\n              [-41.9227937 ,    -11.52676616 ,   \"S\"],\n              [-41.9227937 ,    -15.76393756 ,   \"S\"],\n              [-43.79845795,     -8.625985361,   \"S\"],\n              [-43.22467432,    -10.47974785 ,   \"S\"],\n              [-13.72874433,     9.44562888  ,   \"S\"],\n              [-14.54971549,     8.530832444 ,   \"S\"],\n              [33.94988529 ,    13.19588964  ,   \"S\"],\n              [69.46108546 ,    23.60510962  ,   \"S\"],\n              [79.9786976  ,    12.72308656  ,   \"S\"],\n              [78.64087004 ,    34.91748725  ,   \"S\"],\n              [-47.60015863,   -30.24429763  ,   \"S\"],\n              [-52.49938807,   -35.14352707  ,   \"S\"],\n              [-57.26620591,   -18.76862507  ,   \"S\"],\n              [-58.76687078,   -15.63488371  ,   \"S\"],\n              [-54.57383658,   -12.85423997  ,   \"S\"],\n              [-53.60281813,   -13.03078878  ,   \"S\"],\n              [30.93918652 ,   -55.61717811  ,   \"S\"],\n              [32.58373868 ,   -57.97675294  ,   \"S\"],\n              [33.97803289 ,   -60.2648255   ,   \"S\"],\n              [31.22519559 ,   -62.6959026   ,   \"S\"],\n              [38.07330037 ,   -58.95429872  ,   \"S\"],\n              [39.8021085  ,   -61.02328683  ,   \"S\"],\n              [43.94435199 ,   -54.39176988  ,   \"S\"],\n              [-8.005445306,   -105.0033915  ,   \"S\"],\n              [-2.356766173,   -104.9318892  ,   \"S\"],\n              [30.67780305 ,    -85.10779604 ,   \"S\"],\n              [32.46048329 ,    -84.07571801 ,   \"S\"],\n              [41.77341897 ,    -87.2819446  ,   \"S\"],\n              [44.06113402 ,    -90.49632903 ,   \"S\"],\n              [47.24656004 ,    -81.49026093 ,   \"S\"],\n              [50.3451108  ,    -83.54630863 ,   \"S\"],\n              [51.67719804 ,    -82.88026501 ,   \"S\"],\n              [52.33248013 ,    -98.81150986 ,   \"S\"],\n              [58.84812426 ,    -95.04691547 ,   \"S\"],\n              [53.56322507 ,    -95.84327739 ,   \"S\"],\n              [58.64277685 ,    -86.21382367 ,   \"S\"],\n              [73.95741511 ,    -83.33540582 ,   \"S\"],\n              [59.67565503 ,    -74.68175023 ,   \"S\"],\n              [70.24547773 ,    -69.81673594 ,   \"S\"],\n              [44.55936066 ,    -74.0157066  ,   \"S\"],\n              [55.68343334 ,    -24.77410426 ,   \"S\"],\n              [60.08082279 ,    -32.78235823 ,   \"S\"],\n              [40.16744129 ,    -22.02126697 ,   \"S\"],\n              [-28.65268571,    -34.7891396  ,   \"S\"],\n              [-13.20466495,    -40.96834791 ,   \"S\"],\n              [-9.497139968,    -45.60275414 ,   \"S\"],\n              [-6.407535816,    -46.57377258 ,   \"S\"],\n              [-7.96784617 ,    -54.24914286 ,   \"S\"],\n              [-0.560136995,    -24.5197572  ,   \"S\"],\n              [-10.68766986,    -14.29161588 ,   \"S\"],\n              [-10.16641833,    -11.42473247 ,   \"S\"],\n              [-4.606402005,    -10.72973043 ,   \"S\"],\n              [-0.725973947,    -11.97494241 ,   \"S\"],\n              [-25.80629245,    -24.41817625 ,   \"S\"],\n              [-71.25040192,    -77.43958597 ,   \"S\"],\n              [-64.2745821 ,    -77.98540056 ,   \"S\"],\n              [-59.91294378,    -81.310256   ,   \"S\"],\n              [-62.24452988,    -41.89702708 ,   \"S\"],\n              [-71.38093073,    -34.2612911  ,   \"S\"],\n              [69.51227912 ,      5.467669522,   \"S\"],\n              [70.549062   ,      2.393072019,   \"S\"],\n              [107.9486287 ,     57.55384711 ,   \"S\"],\n              [80.51445449 ,     78.84416438 ,   \"S\"],\n              [83.27260918 ,     86.91681224 ,   \"S\"],\n              [83.47442537 ,     68.88789869 ,   \"S\"],\n              [100.1578976 ,     62.90068486 ,   \"S\"],\n              [64.64441402 ,    109.6664684  ,   \"S\"],\n              [49.1146577  ,     98.60492271 ,   \"S\"],\n              [11.49177673 ,     72.23870395 ,   \"S\"],\n              [15.26641233 ,     54.31944387 ,   \"S\"],\n              [-6.152714418,     52.61545832 ,   \"S\"],\n              [-17.60771933,     30.85955337 ,   \"S\"],\n              [-15.24825692,     22.06359599 ,   \"S\"],\n              [-22.66330689,     22.15187039 ,   \"S\"],\n              [-22.66330689,     20.65120552 ,   \"S\"],\n              [-33.0796866 ,     19.01812904 ,   \"S\"],\n              [-32.63831458,     22.68151682 ,   \"S\"],\n              [-38.37615086,     19.76846147 ,   \"S\"],\n              [-36.56652557,     17.91469898 ,   \"S\"],\n              [-37.096172  ,     28.11039269 ,   \"S\"],\n              [-36.21342795,     33.09789653 ,   \"S\"],\n              [-41.37748061,     15.39887846 ,   \"S\"],\n              [-38.50856246,     18.1795222  ,   \"S\"],\n              [-26.84551443,    -11.1849741  ,   \"S\"],\n              [-53.76052441,     21.78456178 ,   \"S\"],\n              [-80.19844615,     27.63723148 ,   \"S\"],\n              [-36.86304668,      7.09621255 ,   \"S\"],\n              [-33.02311009,      4.756940835,   \"S\"],\n              [-31.52244522,      6.390017315,   \"S\"],\n              [-20.17918426,     -5.571164473,   \"S\"],\n              [-17.48175884,     -9.226660678,   \"S\"],\n              [-26.47267039,     -6.22969016 ,   \"S\"],\n              [-24.87874372,    -11.90844128 ,   \"S\"],\n              [-25.13676322,    -12.61213084 ,   \"S\"],\n              [-50.85272315,     26.86216427 ,   \"S\"],\n              [-48.56412749,     28.44238509 ,   \"S\"],\n              [-54.06765516,     39.77638269 ,   \"S\"],\n              [-48.67310823,     36.77941217 ,   \"S\"],\n              [-48.45514674,     34.32734538 ,   \"S\"],\n              [-43.71448429,     37.92371    ,   \"S\"],\n              [-43.60550354,     35.85307583 ,   \"S\"],\n              [-41.31690787,     40.70271903 ,   \"S\"],\n              [-41.31690787,     38.46861373 ,   \"S\"],\n              [-38.75586034,     40.53924791 ,   \"S\"],\n              [-53.3639135 ,     50.0685607  ,   \"S\"],\n              [-47.5289726 ,     66.29329569 ,   \"S\"],\n              [-41.48054119,     69.01781434 ,   \"S\"],\n              [-46.54814588,     73.81296717 ,   \"S\"],\n              [-58.31806646,     73.21357306 ,   \"S\"],\n              [-19.90235346,     76.59197619 ,   \"S\"],\n              [-67.85380515,     80.87790581 ,   \"S\"],\n              [-85.70244993,     56.09141573 ,   \"S\"],\n              [-87.95576721,     69.31483029 ,   \"S\"],\n              [-94.77501688,     71.50884975 ,   \"S\"],\n              [-95.24939946,     56.0321179  ,   \"S\"],\n              [-50.36555387,     98.81623761 ,   \"S\"],\n              [-45.91821713,    105.3389982  ,   \"S\"],\n              [-43.30911291,     98.40115285 ,   \"S\"],\n              [-34.65060103,     66.54015533 ,   \"S\"],\n              [35.35434846 ,     33.92570089 ,   \"S\"],\n              [41.26219059 ,     29.41076463 ,   \"S\"],\n              [30.45760312 ,    124.6731233  ,   \"S\"],\n              [15.20672482 ,    111.9510896  ,   \"S\"],\n              [6.102884206 ,    112.6124797  ,   \"S\"],\n              [1.356437388 ,    122.2998998  ,   \"S\"],\n              [-33.24663947,    117.5951965  ,   \"S\"],\n              [-42.97148247,    113.9780293  ,   \"S\"],\n              [-44.75041717,    112.4955837  ,   \"S\"],\n              [-35.97433934,    122.1611289  ,   \"S\"],\n              [-33.36523512,    122.5762136  ,   \"S\"],\n              [-99.20350628,     67.5572706  ,   \"S\"],\n              [-98.72912369,     59.25557535 ,   \"S\"],\n              [-56.51147925,     49.43528664 ,   \"S\"],\n              [-57.9610908 ,     47.85962192 ,   \"S\"],\n              [9.815890457 ,    -91.30950062 ,   \"S\"]]]\n  \n            ];\n\nlet starDim = [7, 5, 3];\n\nvar bgColor;\n\nvar meteorShower = false;\nlet meteorStart = [];\nlet meteorEnd = [];\nlet shootOffset = [];\nlet shootWeight = [];\n\nvar shootCount_start = 0;\nvar shootCount_end = 0;\n\nvar n = 200;\nvar nMeteors;\n\nfunction setup() {\n    ellipseMode(CENTER);\n    createCanvas(480, 480);\n    frameRate(10);\n\n    \/\/ each constellation\n    for (var i = 0; i &lt; data.length; i++){ \n        \/\/lines within constellation\n        for (var j = 0; j &lt; data[i].length; j++){ \n            \/\/ indiv stars within constellation\n            for (var k = 0; k &lt; data[i][j].length; k++){ \n                star = data[i][j][k];\n                star[0] = map(star[0], -113, 120, 0, width);\n                star[1] = map(star[1], -113, 120, 0, height);\n\n                var r;\n                var star = data[i][j][k];\n\n                if (star[2] == \"L\"){\n                    r = starDim[0];\n                } else if (star[2] == \"M\"){\n                    r = starDim[1];\n                } else {\n                    r = starDim[2];\n                }\n                star[3] = r;\n            }\n        }\n    }\n}\n\nfunction initiateMeteorShower(){\n    meteorStart = [];\n    meteorEnd = [];\n    shootOffset = [];\n    \/\/meteor steup\n    nMeteors = int(random(0, 10))\n    for (var i = 0; i&lt;nMeteors; i++){\n        var start;\n        var end;\n        var dirX;\n        var dirY;\n\n        \/\/var pathRand = random(0,2)\n\n        if (int(random(0,2)) == 0){\n            start = [0, random(0, height)];\n            end = [width, random(0, height)];\n\n        } else {\n            start = [random(0, width), 0];\n            end = [random(0, width), height];\n\n        }\n        meteorStart.push(start);\n        meteorEnd.push(end);\n        shootOffset.push(random(2, 15));\n        shootWeight.push(random(1,4));\n    }\n}\n\n\n\nfunction draw() {\n    var curTime = (hour()*3600) + (minute()*60) + second();\n    bgColor = map(curTime, 0, 86400, 0, 255);\n\n    background(bgColor);\n\n    \/\/every 10 minutes initiate meteor shower\n    if (minute() %5 == 0){\n        if (!meteorShower){\n            initiateMeteorShower();\n        }\n        meteorShower = true;\n    } else {\n        meteorShower = false;\n    }\n    \n    if (meteorShower){\n        for (var i = 0; i&lt;nMeteors; i++){\n            shootingStar(meteorStart[i], meteorEnd[i], \n                         shootOffset[i], shootWeight[i]);\n        \/\/noLoop();\n        }\n    }\n    \n\n    \/\/go through each constellation, draw lines between each pt\n    for (var i = 0; i &lt; data.length; i++){ \/\/ each constelation\n        \/\/lines within constellation\n        for (var j = 0; j &lt; data[i].length; j++){\n            if (i &lt; hour()%12){\n                drawConstellation(data[i][j]);\n            }\n            \/\/ indiv stars within constellation\n            for (var k = 0; k &lt; data[i][j].length; k++){ \n                drawStars(data[i][j][k]);\n                twinkle(data[i][j][k]);\n            }\n        }\n    }\n\n    \n\n\n}\n\n\nfunction drawStars(star){\n    var r = star[3];\n    push();\n    noStroke();\n    var c = (bgColor+200) %255\n    fill(c)\n    circle(star[0], star[1], star[3]*1.5);\n    pop();\n}\n\nfunction twinkle(star){\n    \/\/constraining star size\n    if ((star[2] == \"L\" & star[3] >= starDim[0]) || \n        (star[2] == \"M\" && star[3] >= starDim[1]) || \n        (star[2] == \"S\" && star[3] >= starDim[2])){\n        star[3] -= random(0.8, 0.8);\n    } else {\n        star[3] += random(-0.8, 0.8);\n    }\n    star[3] = abs(star[3]);\n}\n\nfunction drawConstellation(constellation){\n    var c = (bgColor+200) %255\n    stroke(c);\n    beginShape(LINES);\n    for (var i = 1; i &lt; constellation.length; i++){\n        vertex(constellation[i-1][0], constellation[i-1][1]);\n        vertex(constellation[i][0], constellation[i][1]);\n    }\n    endShape();\n}\n\n\nfunction shootingStar(curStar, nextStar, offset, shootWeight){\n    var dx = (nextStar[0] - curStar[0])\/n;\n    var dy = (nextStar[1] - curStar[1])\/n;\n\n\n    if (shootCount_end &lt; n){\n        shootCount_end ++;\n    }\n    if (shootCount_end &gt; offset){\n        shootCount_start ++;\n        \n    }\n\n    if (shootCount_start == n){\n        shootCount_end = shootCount_end % n;\n        shootCount_start = shootCount_start % n;\n        meteorShower = false;\n    }\n\n    push();\n    strokeWeight(shootWeight);\n    var c = (bgColor+200) %255\n    stroke(c, c, c, 180);\n    line(curStar[0] + (shootCount_start*dx), \n         curStar[1] + (shootCount_start*dy), \n         curStar[0] + (shootCount_end*dx), \n         curStar[1] + (shootCount_end*dy));\n    fill(c, c, c, 200);\n    circle(curStar[0]+ (shootCount_end*dx), curStar[1]+ \n          (shootCount_end*dy), 5);\n    pop();\n\n}\n``<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Before we had clocks, we looked to the skies and celestial bodies above to tell time and orientation. For this project, I&rsquo;ve plotted a night sky with 12 different constellations that appear as the day progresses, with meteor showers occuring every 5 minutes. Basic Features:&ndash; Stars that twinkle randomly&ndash; Background color based on time of &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/09\/project-6-abstract-clock-3\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 6 &#8211; Abstract Clock&#8221;<\/span><\/a><\/p>\n","protected":false},"author":708,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[106,121,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/74146"}],"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\/708"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=74146"}],"version-history":[{"count":7,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/74146\/revisions"}],"predecessor-version":[{"id":74156,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/74146\/revisions\/74156"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=74146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=74146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=74146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}