Junior high School Geometry review, known right triangle angle and adjacent edge length to seek the edge length

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.