Wednesday, June 2, 2010

Baseball Applet:Brandon M.,Marco M.,Lazaro V.

The first thing we did for our applet was to figure out some solid math so when we got to designing the applet, it would be faster and easier to create. The two equations we had for the solid math were X=(cos(a)*v)*t and y=-16t^2+sin(a)*v+s(3.5). Then we had to get values that were reasonable for baseball. Our values were 120ft/s-125ft/s for the ball speed, 310ft -450f for the fence distance, 3ft-37ft for the fence height, and 0-90 degrees for the ball trajectory. WE plugged in our two solid math equations and got two perpendicular lines thats intersection would represent our ball. Then we made our fence that the ball would have to go over. When we made the fence, we had to be sure that it would change as we changed the variables. once we had the fence, we had to make the ball stop at the x-axis. For that we had a long equation that we got from plugging in the a,b, and c values from our y equation(y=-16t^2+sin(a)*v+s(3.5)) in to the quadratic formula. We then put in images to represent our ball and batter. We then wanted the ball to stop at the fence, so we put in the equation-t=d/cos(a)*v. Finally we perfected our applet and all its values and finished our Baseball Applet.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.