开发者

Get length of opposite from adjacent and angle

Im trying to determine where a "shot" will hit the wall from a position and an angle. The player shoots a ball from a certain point with a certain angle towards a wall. And I want to be able to determine if the ball will hit within the bounds of the goal.

This is what i know:

origin: the ball's coordinates

length: the distance to the wall

angle: the angle of the shot

This is what i want to calculate:

point: the position the ball will have when it hits the wall

Get length of opposite from adjacent and angle

Thanks in开发者_如何学运维 advance!


unless i'm missing something:

point y = origin y + length
point x = origin x - length * tan(angle)


in Trig for a right angled triangle Tan(angle) = opposite/adjacent.

This should be all you need to get your position.

It should be noted that this is not a programming question as such and there are probably other places for Maths questions like this. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜