# 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.

## 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 on other sites
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 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 :)

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634058
• Total Posts
3015289
×