Physics golf: inclined shooting "And now for something, completely different."

An angry bird is shot at an angle β to the horizontal at a speed u. The ground is steep, inclined at an angle α. Find the horizontal distance q that the bird traveled before it hit the ground.



Make a function f(α, β, u) that returns the length q: the horizontal distance that the bird traveled before it hit the ground.

Constrains and notes:


-90 &lt; α &lt; 90.
0 &lt; β &lt; 180.
α is always smaller than β.
0 &lt;= u &lt; 10^9.
Assume acceleration due to gravity g = 10.
You may use radians instead of degrees for α, β.
Dimensions of u are irrelevant as long as they are consistent with g and q.
No air resistance or anything too fancy.


Shortest code wins.

See the wikipedia article on projectile motion for some equations.

Samples:

f(0, 45, 10) = 10
f(0, 90, 100) = 0
f(26.565, 45, 10) = 5
f(26.565, 135, 10) = 15
Java

Works for radians only
double q(double a, double b, double u){
          return (Math.abs(((-Math.tan(a)+(Math.tan(b)))*(u*u)*(0.2*(Math.cos(b)*Math.cos(b))))));
      }

Golfed Version (Thanks to Peter)
double z=u*Math.cos(b);return(Math.tan(b)-Math.tan(a))*z*z/5;

Maths Used:
q=u Cos(B) t
q tan(A) = u sin (B) t - .5 * 10 * t^2

- tan (A)  + tan(B) = 5q/u^2 sec^2 (B)
q =  [ - tan(A) + tan (B) ] u^2
    ---------------------
    sec^2(B)*5