Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions Documentation1.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
# Name:
# Name: Annie Zhou

## Examples:
Insert examples here.
void sinwave(){
fill(255);
angle += radians(1);
float y = sin(angle)*300 + height/2;
x+=8;
y+=randomNumber();
if(sizeLimit()){
x=0;
}
ellipse(x, y, major(mouseX,mouseY),minor(mouseX,mouseY));
}
float major(float a, float b){
return a%4+b%3;
}
float minor(float a, float b){
return (a+b)/15;
}
float randomNumber(){
return random(0,20);
}

boolean sizeLimit(){
return x>width;
}
## Description:
Insert description here
This graphic function creates a sin wave of ellipses of sizes that vary based on where your mouse is.

## Syntax:
Demonstrate syntax here

void name(){}
void name(int parameters){}
void name(float parameters){}
void name(boolean parameters){}
##Parameters:
Name and describe parameters here

You can have as many parameters as you like. Parameters have a primitive before them
##Returns:
What type of data does it return?
no data returned

##Other notes:
Anything else?
20 changes: 14 additions & 6 deletions Documentation2.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
# Name:
# Name: Annie Zhou

## Examples:
Insert examples here.
float pyth(float x, float y){
hyp = sqrt(sq(x)+sq(y));
return hyp;
}

## Description:
Insert description here
Returns the hypotenuse of a triangle

## Syntax:
Demonstrate syntax here
float name(){}
float name(parameters){}



name - name of function

##Parameters:
Name and describe parameters here
You can have as many parameters as you like.

##Returns:
What type of data does it return?
a float

##Other notes:
Anything else?
18 changes: 12 additions & 6 deletions Documentation3.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Name:
# Name: Annie Zhou

## Examples:
Insert examples here.
float[] unitVector(float hyp){
float [] thing= new float [2];
thing[0] = mouseX/hyp;
thing[1] = mouseY/hyp;
return thing;
}

## Description:
Insert description here
Physics function that returns the unit vector of your mouse from the origin.

## Syntax:
Demonstrate syntax here
float[] name(){}
float[] name(parameters){}

##Parameters:
Name and describe parameters here
any parameters. I used a float found in a previous function.

##Returns:
What type of data does it return?
an array with 2 floats

##Other notes:
Anything else?
60 changes: 60 additions & 0 deletions sketch_151209a/sketch_151209a.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
float hyp;
float angle = 0;
float x = 0;
void setup(){
size(600,600);
background(0);
}
void draw(){
sinwave();
unitVector(pyth(mouseX,mouseY));
}

//graphic function
//makes a sin wave continuously across the screen
void sinwave(){
fill(255);
angle += radians(1);
float y = sin(angle)*300 + height/2;
x+=8;
y+=randomNumber();

//once sin wave reaches end, restarts at a different place
if(sizeLimit()){
x=0;
}
//turns wave into circles
ellipse(x, y, major(mouseX,mouseY),minor(mouseX,mouseY));
}
//varies major axis of ellipse
float major(float a, float b){
return a%4+b%3;
}
//varied minor axis of ellipse
float minor(float a, float b){
return (a+b)/15;
}
//where the y posiion of your ellipse goes
float randomNumber(){
return random(0,20);
}
//tells once sin wave goes to end of screen
boolean sizeLimit(){
return x>width;
}

//math based function
//gives the hypotenuse length from (0,0) to parameters(where mouse is)
float pyth(float x, float y){

hyp = sqrt(sq(x)+sq(y));
return hyp;
}
//physics based function
//finds the unit vector of where your mouse is.
float[] unitVector(float hyp){
float [] thing= new float [2];
thing[0] = mouseX/hyp;
thing[1] = mouseY/hyp;
return thing;
}