Conversion of radians and angles in JavaScript

Source: Internet
Author: User
Tags acos asin cos numeric value pow sin square root

弧度 = 角度 * Math.PI / 180
角度 = 弧度 * 180 / Math.PI

In the JavaScript Math object:

The sin () method returns the sine of a number.
The tan () method returns a number that represents the tangent of a corner.

Math.sin(x)Math.tan(x)

Parameter x is required. A corner expressed in radians. Multiply the angle by 0.017453293 (2pi/360) to convert to radians (that is, angle * math.pi/180).

The Cos () method returns the cosine of a number.

Math.cos(x)

Parameter x is required. Must be a numeric value.

The ASIN () method returns the inverse chord value of a number.
The ACOs () method returns the inverse cosine of a number.

Math.asin(x)Math.acos(x)

Parameter x is required. Must be a numeric value between X∈[-1, 1].

The Atan () method returns the inverse tangent value of a number.

Math.atan(x)

Parameter x is required. Must be a numeric value.

The POW () method returns the value of the Y-power of X.

Math.pow(x,y)

Parameter x is required. Base Must be a number.
Parameter y is required. The power number. Must be a number.

The sqrt () method returns the square root of a number.

Math.sqrt(x)

Parameter x is required. Must be a number greater than or equal to 0.

    • Review Trigonometric functions

Sine (sin): to edge ratio hypotenuse SinA = A/C

Cosine (COS): Adjacent edge ratio hypotenuse CosA = b/c

Tangent (tan): to edge adjacent edge Tana = A/b

Cotangent (Cot): Adjacent edge-to-edge CotA = b/a

Secant (sec): hypotenuse adjacent Edge

Residual cutting (CSC): hypotenuse ratio to edge

    • Sine theorem

sina/a = sinb/b = sinc/c

Can also be expressed as:

A/sina = B/SINB = C/sinc = 2R (R is the circumscribed circle radius of the triangle)

The trigonometric sine theorem can be used to obtain the area of a triangle:

S = 1/2absinc = 1/2bcsina = 1/2acsinb

    • Cosine theorem

a2 = b2 + C2-2BC CosA
b2 = A2 + c2-2ac Cosb
C2 = a2 + b2-2ab CosC

Can also be expressed as:

Cosa= (C2 +b2-a2)/2BC
cosb= (A2 +c2-b2)/2AC
cosc= (A2 +b2-c2)/2ab

First cosine theorem:

A = b Cosc + c COSB
b = C Cosa + a Cosc
c = a COSB + b cosa

    • Tangent theorem

(A + B)/(a) = tan ((A + B)/2)/tan ((-a)/2)

Conversion of radians and angles in JavaScript

Related Article

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.