Finding the angle.

49 Views Asked by At

first question here.

I ran into a problem where my math skills are just not enough, probably it's simple, but I don't know how to approach it.

I'll show you this graphic so you can understand what I need to find:

finding beta

The green line represents the movement of an unit in a videogame I'm developing, the idea is that the unit can accelerate until it reaches the proper angle, then it advances in a straight line and then "parks the car".

Programatically speaking, I need to know the value of the ß angle before I even start moving the unit, then it's just a mirror, no problem from there.

Do you guys have an idea of how to find such angle based on what I've showed you?.

1

There are 1 best solutions below

1
On

Stop rotating when $\frac{midpoint.x-obj.x}{midpoint.y-obj.y}\approx\tan( unit.rotation)$