Python sin () function

Source: Internet
Author: User
Tags sin

Describe

sin () returns the sinusoidal value of the X-arc.

Grammar

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

Import Mathmath.sin (x)

Note:sin () 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.
return value

Returns the sine of the x radians, with a value between 1 and 1.

Instance

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

#!/usr/bin/python3import mathprint ("Sin (3):",  Math.sin (3)) Print ("Sin ( -3):",  Math.sin ( -3)) print ("Sin (0): ",  Math.sin (0)) print (" Sin (Math.PI): ",  Math.sin (Math.PI)) print (" Sin (MATH.PI/2): ",  Math.sin (math.pi/ 2))

When the above instance is run, the output is:

Sin (3):  0.1411200080598672sin ( -3):  -0.1411200080598672sin (0):  0.0sin (Math.PI):  1.2246467991473532e-16sin (MATH.PI/2):  1.0

Python sin () function

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.