I believe that in the face of procedural problems involving geometric operations, there is no need to draft a direct strike out the correct code of the great God is present, of course I am not.
Recently encountered a practical problem, need to use the knowledge of trigonometric functions learned in junior high school to solve, the problem is described by trigonometric function is in a right triangle, known as a angle α angle, and the angle α of the adjacent edge length A, the angle α of the side length B.
Immediately think of must be using tan this function, although I forgot what to call, Baidu just remembered to be called tangent function, well, calculate my entry to now 6, 7 years time, basically are using atan2. Tan This function seems to be useless to three times, you do not believe, the game front-end development is mostly in writing logic, the time to write math algorithm is not many.
Two points:
1,tan (radians of α) = edge length b/collar edge length A
2, Radian = angle * pi/180
Then the code (JS) to write the answer is B = Math.tan (α* math.pi/180) * A.
Junior high School Geometry review, known right triangle angle and adjacent edge length to seek the edge length