//prepare values for angle computation
// the distance between the vectors
Real staightDistance = start.distance(stop);
// height on y
Real height = stop.y - start.y;
// distance on local x
Real distance = Math::Sqrt(staightDistance*staightDistance - height*height);
Real speed = getMaxThrowSpeed();
Real gravity = Math::Abs(SettingsManager::getSingleton().getGravity());
// compute angles from horizontal
Radian angle = Math::ATan((Math::Sqr(speed)-Math::Sqrt(Math::Pow(speed,4) - gravity*(gravity*Math::Sqr(distance)+2*height*Math::Sqr(speed))))/(gravity*distance));
//Radian angle = Math::ATan((Math::Sqr(speed)+Math::Sqrt(Math::Pow(speed,4) - gravity*(gravity*Math::Sqr(distance)+2*height*Math::Sqr(speed))))/(gravity*distance));
// compute velocity vector
Vector3 velocity = stop - start;
velocity.y = distance * Math::Tan(angle);
velocity.normalise();
velocity = velocity * speed;
return velocity;
I still have a question, there are two results to the equation, what is the difference between them?

