{"id":5128,"date":"2020-09-16T13:14:54","date_gmt":"2020-09-16T17:14:54","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/?page_id=5128"},"modified":"2020-11-01T04:29:39","modified_gmt":"2020-11-01T09:29:39","slug":"4-skillz","status":"publish","type":"page","link":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/deliverables\/4-skillz\/","title":{"rendered":"#4 Exercises"},"content":{"rendered":"<h2>Sharpening your Skillz.<\/h2>\n<p>Below are 20 brief exercises. Execute as many as you can before class on Wednesday, 9\/23. Find a balance between banging this work out, and making your sketches look reasonably nice.<\/p>\n<p><em>In a blog post: <\/em><\/p>\n<ul>\n<li>Provide links to the 20 sketches at the online p5.js web editor.<\/li>\n<li>Provide a screenshot of each program, or an animated GIF if you prefer.<\/li>\n<li>Unless you have other goals, make all of your sketches 600&#215;600.<\/li>\n<li>Categorize your blog post, <em>04-Exercises<\/em><\/li>\n<li>Title your blog post, <em>nickname-Exercises<\/em><\/li>\n<\/ul>\n<h2>Exercises<\/h2>\n<p class=\"p2\"><strong>01. One with Everything<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_with_everything.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5153\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_with_everything.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_with_everything.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_with_everything-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\"><a href=\"https:\/\/p5js.org\/reference\/\">Seriously take 5 minutes to browse the p5.js Reference<\/a>. Explore your graphics toolset by drawing one of each type of primitive it provides. For example: draw a rectangle, rounded-rectangle, ellipse, arc, line segment, B\u00e9zier curve, polyline, and multi-sided polygon. Experiment with their rendering options and parameters, such as fill color, stroke weight, closed or open, etc. Using <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/push\">push<\/a>(), <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/rotate\">rotate<\/a>(), <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/translate\">translate<\/a>(), and <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/pop\">pop<\/a>(), draw one shape rotated by 30\u00b0.<\/p>\n<p class=\"p2\"><strong>02. Quadrilateral Zoo<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/quadrilateral_zoo.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5154\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/quadrilateral_zoo.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/quadrilateral_zoo.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/quadrilateral_zoo-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Write commands to plot the vertices of a family of quadrilaterals: square, rectangle, parallelogram, rhombus, trapezoid, dart, and kite. You&#8217;re not permitted to use the rect() command. (Can you add a control parameter to them, that links their form to the position of the cursor?)<\/p>\n<p class=\"p1\"><strong>03. Spiral<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/spiral.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5157\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/spiral.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/spiral.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/spiral-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Write a program that draws a spiral. Before you begin, check into different types of spirals, such as <a href=\"https:\/\/mathworld.wolfram.com\/ArchimedesSpiral.html\">Archimedes\u2019s spiral<\/a> (the radius of which grows arithmetically) and the <a href=\"https:\/\/mathworld.wolfram.com\/LogarithmicSpiral.html\">logarithmic or equiangular spiral<\/a> (whose radius grows geometrically). Consider different implementations, such as explicitly plotting your spiral using polar equations, implicitly rendering it by summing small differences (e.g. go forward, turn slightly, repeat), or approximating it piecewise with circular arcs.<\/p>\n<p class=\"p2\"><strong>04. Transitioning Rectangles<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/transitioning_rectangles.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5159\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/transitioning_rectangles.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/transitioning_rectangles.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/transitioning_rectangles-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Recall that <i>any <\/i>visual property can be linked to a loop variable, not just position. Use iteration to generate a series of rectangles. Your code should simultaneously control several of the rectangles\u2019 visual properties, including their position, height, and fill color. (Are you able to use a shaping function to make the transition non-linear?) Consider using the <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/map\">map<\/a>(), <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/lerp\">lerp<\/a>(), and <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/lerpColor\">lerpColor<\/a>() commands.<\/p>\n<p class=\"p1\"><strong>05. Iteration with Functions<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/iteration_with_functions.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5160\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/iteration_with_functions.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/iteration_with_functions.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/iteration_with_functions-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\"><a href=\"https:\/\/p5js.org\/examples\/structure-functions.html\">Write a function<\/a> that encapsulates the code to render a simple visual element (a leaf, face, etc.). Give your function arguments that determine where the element will be positioned. Using iteration, call your function to display a grid of these elements.<\/p>\n<p class=\"p2\"><strong>06. Random Splat<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/random_splat.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5161\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/random_splat.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/random_splat.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/random_splat-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Plot the vertices of a many-sided polygon, using the functions <span class=\"s1\">sin() <\/span>and <span class=\"s1\">cos() <\/span>in the same way that you might generate a circle, but compute the position of each point with a radius that is slightly randomized. How closely can you make the result resemble a drop of ink? Consider using the <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/beginShape\">beginShape<\/a>(), vertex(), and endShape() commands.<\/p>\n<p class=\"p1\"><strong>07. Stochastic Elements<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/stochastic_elements-1.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5165\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/stochastic_elements-1.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/stochastic_elements-1.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/stochastic_elements-1-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Create an evocative composition in which an iterative loop deposits small elements in random locations around the canvas. These elements might look like craters, potholes, pimples, ants, chocolate chips, holes in Swiss cheese&#8230;<\/p>\n<p class=\"p2\"><strong>08. Recoding <i>Schotter<\/i><\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/bild.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5167\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/bild.jpg\" alt=\"\" width=\"196\" height=\"360\" \/><\/a><\/p>\n<p class=\"p3\"><a href=\"https:\/\/collections.vam.ac.uk\/item\/O221321\/schotter-print-nees-georg\/\"><i>Schotter <\/i><\/a>by Georg Nees (1968) is a classic algorithmic computer artwork, now more than 50 years old, that depicts a gradient from order to chaos across a 12&#215;22 grid of squares. In it, the squares\u2019 orientations become increasingly randomized towards the bottom of the page. Re-code this work, paying attention to detail.<\/p>\n<p class=\"p1\"><strong>09. Billiard Ball<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/bouncing_ball.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5168\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/bouncing_ball.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/bouncing_ball.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/bouncing_ball-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Create a sketch with a moving ball that bounces off the edges of the canvas. Take care that the ball <em>never<\/em> appears to overlap the edge of the canvas. Suggestion: give the ball position and velocity variables; flip the sign of the velocity variables when the ball encounters the edge of the canvas.<\/p>\n<p class=\"p2\"><strong>10. One-Person Pong<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_person_pong.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5169\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_person_pong.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_person_pong.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/one_person_pong-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Create a sketch that recreates the game of Pong for a single user. Can you add a scoring system?<\/p>\n<p class=\"p2\"><strong>11. Hitomezashi Sashiko Stitching<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/hitomezashi_sashiko.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5170\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/hitomezashi_sashiko.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/hitomezashi_sashiko.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/hitomezashi_sashiko-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Randomly label the columns and rows of a grid with <span class=\"s1\">0<\/span>s and <span class=\"s1\">1<\/span>s. For each column, draw a vertical sequence of alternating dashes and gaps, beginning with a dash (for columns labeled <span class=\"s2\">1<\/span>) or a gap (for columns labeled <span class=\"s2\">0<\/span>). Similarly, draw horizontal sequences of dashes and gaps for the rows. Observe the resulting patterns.<\/p>\n<blockquote class=\"twitter-tweet\" data-width=\"550\" data-dnt=\"true\">\n<p lang=\"en\" dir=\"ltr\">As promised, here is <a href=\"https:\/\/twitter.com\/maths_kath?ref_src=twsrc%5Etfw\">@maths_kath<\/a>\u2019s <a href=\"https:\/\/twitter.com\/hashtag\/mathartchallenge?src=hash&amp;ref_src=twsrc%5Etfw\">#mathartchallenge<\/a>! <\/p>\n<p>Based on traditional Japanese stitching, this is a riff on hitomezashi patterns. Using grid paper, give each line (vertical &amp; horizontal) a 0 or 1. (See pictures below, too,) \u201cStitch\u201d each line accordingly. <a href=\"https:\/\/twitter.com\/hashtag\/mtbos?src=hash&amp;ref_src=twsrc%5Etfw\">#mtbos<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/mathart?src=hash&amp;ref_src=twsrc%5Etfw\">#mathart<\/a> <a href=\"https:\/\/t.co\/6i0zYx2rI4\">pic.twitter.com\/6i0zYx2rI4<\/a><\/p>\n<p>&mdash; Annie Perkins (@anniek_p) <a href=\"https:\/\/twitter.com\/anniek_p\/status\/1244220881347502080?ref_src=twsrc%5Etfw\">March 29, 2020<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p class=\"p1\"><strong>12. Imaginary Islands<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/imaginary_islands.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5171\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/imaginary_islands.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/imaginary_islands.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/imaginary_islands-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Use a two-dimensional Perlin noise function to generate a map of imaginary islands. For every pixel: if the value of the noise function is below some threshold value, color the pixel blue (for water); if it is higher than the threshold, color it brown (for land). You will want to use the <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/noise\">noise<\/a>() (with two arguments), <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/noiseDetail\">noiseDetail<\/a>(), <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/set\">set<\/a>(), and <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/updatePixels\">updatePixels<\/a>() functions in p5.js.<\/p>\n<p class=\"p2\"><strong>13. Drawn Line, Three Ways<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/livingline_1.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5174\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/livingline_1.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/livingline_1.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/livingline_1-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Create an interaction that stores the past 100 mouse positions, and displays them as a polyline. Store the mouse data in three different ways: in two 1D arrays (one for X, one for Y); in one 2D array; and in an array of Point2D objects.<\/p>\n<p class=\"p1\"><strong>14. Calligraphic Polyline<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/calligraphic_polyline.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5175\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/calligraphic_polyline.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/calligraphic_polyline.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/calligraphic_polyline-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Create a sketch that stores the past 100 mouse positions. Draw a line between each point and the one previous to it. Make the thickness of this line (e.g. strokeWeight(), or some other visual technique) inversely proportional to the distance between each pair of points, so that faster marks make thinner lines.<\/p>\n<p class=\"p1\"><strong>15. Longest Line Search<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/longest_line.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5179\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/longest_line.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/longest_line.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/longest_line-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Write a program that accumulates an array of straight line segments when the user clicks and drags. Color the longest line red.<\/p>\n<p class=\"p2\"><strong>16. Eyes Following Cursor<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/eyes.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5180\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/eyes.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/eyes.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/eyes-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Draw one or more eyes with pupils that follow the cursor. If you can, constrain each pupil to stay within its eyeball.<\/p>\n<p class=\"p1\"><strong>17. Ripples in a Pond<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/ripple.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5181\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/ripple.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/ripple.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/ripple-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Create a program in which animated circular \u201cripples\u201d emanate outward from the cursor each time the mouse button is clicked. Consider the speed at which your ripples expand. Implement your ripples in an object-oriented coding style. See <a href=\"https:\/\/p5js.org\/examples\/objects-array-of-objects.html\">this p5.js example<\/a> for an array of objects in p5.js.<\/p>\n<p class=\"p2\"><strong>18. Butt Generator<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/butt_generator.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5182\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/butt_generator.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/butt_generator.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/butt_generator-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Write a program that uses arcs or B\u00e9zier curves to generate one or more butts.<\/p>\n<p class=\"p1\"><strong>19. Angle between Three Points<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/angle_between_3_points.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5183\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/angle_between_3_points.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/angle_between_3_points.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/angle_between_3_points-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p1\">Write a program that computes the interior angle between three points: two randomly placed points, A and B, and the mouse cursor, C. <i>Hint<\/i>: Use the dot product to compute the angles, and use the cross product to distinguish positive from negative curvature. The <a href=\"https:\/\/p5js.org\/reference\/#\/p5\/atan2\">atan2<\/a>() function could also be helpful.<\/p>\n<p class=\"p2\"><strong>20. Circle from Three Points (Circumcenter)<\/strong><\/p>\n<p><a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/triangle_circumcenter.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-5184\" src=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/triangle_circumcenter.png\" alt=\"\" width=\"200\" height=\"200\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/triangle_circumcenter.png 200w, https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-content\/uploads\/2020\/09\/triangle_circumcenter-150x150.png 150w\" sizes=\"(max-width: 200px) 85vw, 200px\" \/><\/a><\/p>\n<p class=\"p3\">Construct a random triangle whenever a button is pressed. Generate a circle that passes precisely through all three of its vertices. The center of this circle is called the <i>circumcenter <\/i>of the triangle. Place a dot there. <em>Note<\/em>: the circumcenter is not always inside the triangle. See <a href=\"http:\/\/paulbourke.net\/geometry\/circlesphere\/\">this page<\/a> for help with the math.<\/p>\n<p class=\"p1\">\n","protected":false},"excerpt":{"rendered":"<p>Sharpening your Skillz. Below are 20 brief exercises. Execute as many as you can before class on Wednesday, 9\/23. Find a balance between banging this work out, and making your sketches look reasonably nice. In a blog post: Provide links to the 20 sketches at the online p5.js web editor. Provide a screenshot of each &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/deliverables\/4-skillz\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;#4 Exercises&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":79,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/pages\/5128"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/comments?post=5128"}],"version-history":[{"count":17,"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/pages\/5128\/revisions"}],"predecessor-version":[{"id":6916,"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/pages\/5128\/revisions\/6916"}],"up":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/pages\/79"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-212\/f2020\/wp-json\/wp\/v2\/media?parent=5128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}