Python atan2 () function

Source: Internet
Author: User

Describe

atan2 () returns the inverse tangent value of the given X and Y coordinate values.

Grammar

The following is the syntax for the ATAN2 () method:

Import mathmath.atan2 (y, x)

Note:atan2 () is not directly accessible, you need to import the math module, and then call the method through the math static object.

Parameters
    • X--a numeric value.
    • Y--a numeric value.
return value

Returns the inverse tangent value of the given X and Y coordinate values.

Instance

The following shows an example of using the Atan2 () method:

#!/usr/bin/python3import Mathprint ("atan2 ( -0.50,-0.50):",  math.atan2 ( -0.50,-0.50)) print ("Atan2 (0.50,0.50):" ,  math.atan2 (0.50,0.50)) print ("Atan2 (5,5):",  math.atan2 (5,5)) print ("Atan2 ( -10,10):",  math.atan2 (- 10,10) Print ("Atan2 (10,20):",  math.atan2 (10,20))

When the above instance is run, the output is:

Atan2 ( -0.50,-0.50):  -2.356194490192345atan2 (0.50,0.50):  0.7853981633974483atan2 (5,5)  : 0.7853981633974483atan2 ( -10,10):  -0.7853981633974483atan2 (10,20):  0.4636476090008061

Python atan2 () function

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.