This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
CurveBetween function by Natalie Freed, 9/22/16 | |
Draws symmetrical bezier curves between two points, | |
includes example of use | |
*/ | |
function setup() { | |
createCanvas(600, 600); | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Classes and objects with arrays example | |
Natalie Freed for Art and Science of Computing May 16, 2016 | |
Whale function by Courtney Peterson, March 9, 2016 | |
From: Whales in Love https://gist.github.com/anonymous/5d5b9bdef5243e8c2973 | |
*/ | |
Whale orangeWhale; | |
Whale greenWhale; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
//TODO: Change these variable names to the correct notes | |
Servo a; | |
Servo b; | |
Servo c; | |
Servo d; | |
Servo e; | |
Servo f; | |
Servo g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Starting point for sorting algorithm implementation */ | |
int[] array = new int[8]; | |
void setup() | |
{ | |
//fill the array with random numbers | |
for(int i=0;i<array.length;i++) | |
{ | |
array[i] = round(random(-1000, 1000)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Starting point for sorting algorithm implementation */ | |
int[] array = new int[100000]; | |
void setup() | |
{ | |
//fill the array with random numbers | |
for(int i=0;i<array.length;i++) | |
{ | |
array[i] = round(random(-1000, 1000)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Tiny composition book cover generator | |
//Natalie Freed 2014 | |
//Learned about using Perlin noise to make 2D textures from | |
//Daniel Shiffman's Nature of Code: http://natureofcode.com/book/introduction/ | |
int labelCenterX, labelCenterY, labelWidth, labelHeight; | |
int labelMargin = 16; | |
int outlineMargin = 24; | |
int labelCorner = 10; | |
int lineMargin = 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Natalie Freed for Art and Science of Computing Spring 16 | |
Example of using a mathematical function to animate a shape's movement (includes classes) | |
*/ | |
Shape slowShape, fastShape, superFastShape; | |
void setup() { | |
size(500, 500); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Classes and objects with arrays example | |
Natalie Freed for Art and Science of Computing March 28, 2016 | |
Whale function by Courtney Peterson, March 9, 2016 | |
From: Whales in Love https://gist.github.com/anonymous/5d5b9bdef5243e8c2973 | |
*/ | |
Whale orangeWhale; | |
Whale greenWhale; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Things to do: | |
1. Change the shape of the zigzagging object. | |
2. Change the speed of the zigzagging object. | |
4. Add another zigzagging object with a different starting x. | |
5. Add another zigzagging object with the same starting x but a different speed. | |
6. Change the movement function to something other than a zigzag | |
7. Save your results to your shared folder. | |
8. If you are done with both exercises, add a whole bunch of zigzagging shapes with | |
randomized starting locations and speeds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Things to do: | |
1. Change the shape of the moving object. | |
2. Change the velocity and observe what happens. | |
3. Change the velocity so that the object moves horizontally. | |
4. Change the velocity so the object moves vertically. | |
5. Add a second shape that starts in a different location than the first but moves with the same velocity. | |
6. Add a third shape that moves at a different velocity from the other two. | |
7. Add another PVector variable called acceleration. Add it to velocity every frame. What changes? | |
8. Turn your results in to your shared folder. |