Sunday, December 16, 2012

12/12/12 Officially Started!


Today I went to Siena College for my first internship meeting.
When got into the office Dr. Bellis was helping two student for their final exam which was coming after two hours. I sat down and also helped them.... because I just took a semi-miditerm on Monday for AP Physics. After that we got started on Processing. Dr. Bellis shared some exercise on Google Doc and taught me what the abbreviations mean. I did one simulation in his office and had a hard time because I kept forgetting to put the semicolon after each command. Getting the basics, I went downstairs to the lab to do read some instructions on the Processing website.

Things I learned,
How to draw a...
1. Line     line(x1,y1,x2,y2);
2. Point    point(x,y)
3. rectangle rect (x,y,width,height) --> there are many ways one can draw a rectangle, the same thing goes for ellipses, which have different modes one can use--center or corner modes)

I also learned how to change the color filling of each shape by using the mix of red, green, and blue color codes and how to adjust the color transparency.


The first exercise I did was:
Create a demo, that has a ball drop from the top of the window and fall, assuming
that it is accelerating due to gravity.

The key to this demo is to remember how to calculate the position of an object if it is undergoing constant acceleration. Then you can tell Processing where to ``draw” the object in each frame.

Answer:
float x = 100;
float y = y0+.5*g*t*t+t;

Equation used: delta y= v0*t+.5*a*t*t

I had a lot of fun making the window where the ball is dropped out, and changing the color of the box using color selector (Tool--> Color Selector). I also learn how to change the frame rate and/or gravity to make the ball go slower so that it is clearer to see. 




The second exercise was to simulate projectile motion: 


Answer:
float x = 100+v0*t*cos(.25);
float y = 100-v0*t*sin(.25)+.5*g*t*t;

I used delta x=v0*t+.5*a*t^2 to find the position of the X and Y coordinates.
The velocity of X is not affected by gravity so the .5*a*t^2 part of the equation can be ignored.
The velocity of Y, however, is reduced by gravity as gravity accelerated it downward. For Processing, the coordinates start with (0,0) on the upper left corner, so we had to modify the equation so that the ball will go in projectile motion (change to Y gets lower as it shot out and higher as it landed).

This is kind of fun because I can see the actually ball hitting the ground even though it is on a computer. During the course of solving this exercise, I started out using the range equation for x but somehow it did not work and the actual result is actually much simple than that. :)


The first meeting was fun and I learned a lot, I took a lot of notes too. Next week I will be in Revels rehearsals so our next meeting will be after break.

2 comments:

  1. Great post, Yvonne! You include lots of interesting information and fantastic illustrations. I find it very easy to follow your work, and I am excited to track your progress. Keep up the excellent effort!

    ReplyDelete
  2. Yvonne,

    Mr. Calos has invited us to read these posts and comment; I am grateful for the opportunity.

    Your project sounds most promising. I am wondering if you could bring a sample of your work to class some time and demonstrate it.

    You made good use of the range equation here. This is not an equation we normally use in AP Physics, but you seem to have found it useful. Would you recommend spending more time with it?

    I look forward to seeing future projects.

    John Ball

    ReplyDelete