Javascriptatan2 () calculates the X axis to a certain point.

Source: Internet
Author: User
The javascriptatan2 () method returns an angle between the x axis and the point (x, y. This function has two parameters: the first parameter specifies the X coordinate of the vertex, and the second parameter specifies the Y coordinate of the vertex. Note that the parameter order of this function is passed before the X coordinate. This article describes the basic syntax and examples of the atan2 function. For more information about the coders, see. The atan2 method returns the angle (in radians) from the X axis to the (y, x) Point ).

Basic Syntax:

Math.atan2(y, x)

Parameter Introduction

Parameters Description
X Required. A numeric expression that describes the coordinates of flute x.
Y Required. The numeric expression that describes the y coordinate of the flute.

Return Value

The returned value is between-pi and pi, indicating the angle of the provided (y, x) Point.

Note:

  1. The Parameter order of this function. The Y coordinate is transmitted before the X coordinate.
  2. If the value of a parameter in the function is not a number, the function returns NaN

Instance

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.