擅长:python、mysql、java
<p>您需要在Python中查找<a href="https://docs.python.org/2/library/math.html" rel="nofollow noreferrer">math</a>模块。见<a href="https://docs.python.org/2/library/math.html#math.sin" rel="nofollow noreferrer">this</a></p>
<pre><code>math.sin(x) ** 2
</code></pre>
<p>您也可以使用<code>math.pow(x,y)</code>。参见<a href="https://docs.python.org/3.2/library/math.html#math.pow" rel="nofollow noreferrer">this</a>了解如何将数字x提升为y的幂</p>
<p>一个小示例程序</p>
<pre><code>import math
rad = int(input("Enter radians: "))
print(math.sin(rad) ** 2)
</code></pre>
<p>如果您想从弧度转换为度,或者从弧度转换为度,请查看<a href="https://docs.python.org/3.2/library/math.html#angular-conversion" rel="nofollow noreferrer">this</a></p>