|
Re: Calculating Angle to fire at
This equation doesn't incorporate air resistance or spin, but it'll work for approximating. I have a sinking feeling that there isn't a way to do it with all the variables without forcing the controller to do a numerical integration every time you want to shoot the ball
(theta1)= the angle to the goal from the same height as your cannon
(theta2)= the angle of your cannon
(h)= height from your cannon to the goal (constant)
(v)= velocity of your ball (constant)
1/(v^2) = (tan(theta2)cos^2(theta2)/4.9h(cot(theta1))) - (cos^2(theta2)/4.9h(cot^2(theta1)))
It could use some simplifying, and it looks really ugly typed like that, but it works. I like this equation better because rather than accounting for distance to the goal, you only need the angle. I have a feeling the CMU cameras will be more accurate at giving the angle they are pointing at rather than giving a distance to the target.
__________________
Team 253
2004 Silicon Valley AVA Winner
Last edited by White_Orpheus : 08-01-2006 at 22:33.
|