Advertisement Jump to content
Sign in to follow this  
Davi Doro

Find the domain of this function.

This topic is 854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Look at this function at wikipedia

 

That's the angle required to hit coordinate (x,y) given x, y, initial speed v and gravity g.

Now I want to find the values of v for which the function is not complex, i.e.:

 

v? - g(gx² + 2yv²) ? 0

 

Again, g, x and y are constants.

 

Can you help me with this?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
That's a second-degree inequality in v^2:

(v^2)^2 - 2gy * v^2 - g^2x^2 >= 0

The solutions are values of v for which

v^2 >= g * (y + sqrt(y^2 + x^2))
or
v^2 <= g * (y - sqrt(y^2 + x^2))

But (y - sqrt(y^2 + x^2)) is always negative, so the second condition never really happens.

Taking a square root on the first inequality, you get what I think is the final answer:

abs(v) >= sqrt(g * (y + sqrt(y^2 + x^2)))

Share this post


Link to post
Share on other sites

Ah, thanks! You are correct, I found my mistake, at some point I forgot a parentesis and got:

 

abs(v) >= sqrt(gy + sqrt(y^2 + x^2))

 

Now I can land my arrows accurately :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!