{"id":1054115,"date":"2024-12-31T14:39:39","date_gmt":"2024-12-31T06:39:39","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1054115.html"},"modified":"2024-12-31T14:39:41","modified_gmt":"2024-12-31T06:39:41","slug":"python%e5%a6%82%e4%bd%95%e8%ae%a1%e7%ae%97%e4%b8%89%e8%a7%92%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1054115.html","title":{"rendered":"python\u5982\u4f55\u8ba1\u7b97\u4e09\u89d2\u51fd\u6570"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/623b356b-4e6f-49c4-82c9-b21138fb0c4d.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u8ba1\u7b97\u4e09\u89d2\u51fd\u6570\" \/><\/p>\n<p><p> <strong>Python\u8ba1\u7b97\u4e09\u89d2\u51fd\u6570\u7684\u65b9\u6cd5<\/strong>\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684\u6570\u5b66\u5e93<code>math<\/code>\uff0c\u5305\u62ec<code>sin<\/code>\u3001<code>cos<\/code>\u3001<code>tan<\/code>\u7b49\u51fd\u6570\u3002<strong>\u9996\u5148\u5bfc\u5165math\u5e93\u3001\u4f7f\u7528math.sin()\u8ba1\u7b97\u6b63\u5f26\u503c\u3001\u4f7f\u7528math.cos()\u8ba1\u7b97\u4f59\u5f26\u503c\u3001\u4f7f\u7528math.tan()\u8ba1\u7b97\u6b63\u5207\u503c<\/strong>\u3002\u4e0b\u9762\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5bfc\u5165math\u5e93<\/h3>\n<\/p>\n<p><p>Python\u7684\u6807\u51c6\u5e93\u4e2d\u5305\u542b\u4e86\u8bb8\u591a\u6709\u7528\u7684\u6570\u5b66\u51fd\u6570\uff0c\u5176\u4e2d\u5c31\u5305\u62ec\u4e86\u4e09\u89d2\u51fd\u6570\u3002\u8981\u4f7f\u7528\u8fd9\u4e9b\u51fd\u6570\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u5bfc\u5165<code>math<\/code>\u5e93\u3002\u5bfc\u5165\u65b9\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728\u4ee3\u7801\u7684\u5f00\u5934\u6dfb\u52a0\u4e00\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528math.sin()\u8ba1\u7b97\u6b63\u5f26\u503c<\/h3>\n<\/p>\n<p><p>\u6b63\u5f26\u51fd\u6570\u662f\u4e09\u89d2\u51fd\u6570\u4e2d\u6700\u57fa\u7840\u7684\u4e00\u4e2a\uff0c\u5b83\u8868\u793a\u4e00\u4e2a\u89d2\u7684\u5bf9\u8fb9\u548c\u659c\u8fb9\u7684\u6bd4\u503c\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>math.sin()<\/code>\u51fd\u6570\u6765\u8ba1\u7b97\u6b63\u5f26\u503c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<code>math.sin()<\/code>\u51fd\u6570\u7684\u53c2\u6570\u662f\u4ee5\u5f27\u5ea6\u4e3a\u5355\u4f4d\u7684\u89d2\u5ea6\u503c\u3002\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u4ee5\u5ea6\u6570\u4e3a\u5355\u4f4d\u7684\u89d2\u5ea6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>math.radians()<\/code>\u51fd\u6570\u5c06\u5176\u8f6c\u6362\u4e3a\u5f27\u5ea6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u4ee5\u5f27\u5ea6\u8ba1\u7b97<\/strong><\/h2>\n<p>angle_radians = math.pi \/ 2  # 90\u5ea6<\/p>\n<p>sin_value = math.sin(angle_radians)<\/p>\n<p>print(f&quot;sin(90\u00b0) = {sin_value}&quot;)<\/p>\n<h2><strong>\u4ee5\u5ea6\u6570\u8ba1\u7b97<\/strong><\/h2>\n<p>angle_degrees = 90<\/p>\n<p>angle_radians = math.radians(angle_degrees)<\/p>\n<p>sin_value = math.sin(angle_radians)<\/p>\n<p>print(f&quot;sin(90\u00b0) = {sin_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528math.cos()\u8ba1\u7b97\u4f59\u5f26\u503c<\/h3>\n<\/p>\n<p><p>\u4f59\u5f26\u51fd\u6570\u540c\u6837\u662f\u4e09\u89d2\u51fd\u6570\u7684\u57fa\u7840\u51fd\u6570\u4e4b\u4e00\uff0c\u5b83\u8868\u793a\u4e00\u4e2a\u89d2\u7684\u90bb\u8fb9\u548c\u659c\u8fb9\u7684\u6bd4\u503c\u3002\u53ef\u4ee5\u4f7f\u7528<code>math.cos()<\/code>\u51fd\u6570\u6765\u8ba1\u7b97\u4f59\u5f26\u503c\u3002\u4e0e<code>math.sin()<\/code>\u51fd\u6570\u76f8\u540c\uff0c<code>math.cos()<\/code>\u51fd\u6570\u7684\u53c2\u6570\u4e5f\u662f\u4ee5\u5f27\u5ea6\u4e3a\u5355\u4f4d\u7684\u89d2\u5ea6\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u4ee5\u5f27\u5ea6\u8ba1\u7b97<\/strong><\/h2>\n<p>angle_radians = math.pi  # 180\u5ea6<\/p>\n<p>cos_value = math.cos(angle_radians)<\/p>\n<p>print(f&quot;cos(180\u00b0) = {cos_value}&quot;)<\/p>\n<h2><strong>\u4ee5\u5ea6\u6570\u8ba1\u7b97<\/strong><\/h2>\n<p>angle_degrees = 180<\/p>\n<p>angle_radians = math.radians(angle_degrees)<\/p>\n<p>cos_value = math.cos(angle_radians)<\/p>\n<p>print(f&quot;cos(180\u00b0) = {cos_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528math.tan()\u8ba1\u7b97\u6b63\u5207\u503c<\/h3>\n<\/p>\n<p><p>\u6b63\u5207\u51fd\u6570\u8868\u793a\u4e00\u4e2a\u89d2\u7684\u5bf9\u8fb9\u548c\u90bb\u8fb9\u7684\u6bd4\u503c\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>math.tan()<\/code>\u51fd\u6570\u6765\u8ba1\u7b97\u6b63\u5207\u503c\u3002\u540c\u6837\u5730\uff0c<code>math.tan()<\/code>\u51fd\u6570\u7684\u53c2\u6570\u4e5f\u662f\u4ee5\u5f27\u5ea6\u4e3a\u5355\u4f4d\u7684\u89d2\u5ea6\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u4ee5\u5f27\u5ea6\u8ba1\u7b97<\/strong><\/h2>\n<p>angle_radians = math.pi \/ 4  # 45\u5ea6<\/p>\n<p>tan_value = math.tan(angle_radians)<\/p>\n<p>print(f&quot;tan(45\u00b0) = {tan_value}&quot;)<\/p>\n<h2><strong>\u4ee5\u5ea6\u6570\u8ba1\u7b97<\/strong><\/h2>\n<p>angle_degrees = 45<\/p>\n<p>angle_radians = math.radians(angle_degrees)<\/p>\n<p>tan_value = math.tan(angle_radians)<\/p>\n<p>print(f&quot;tan(45\u00b0) = {tan_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5176\u4ed6\u76f8\u5173\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u7684<code>sin<\/code>\u3001<code>cos<\/code>\u548c<code>tan<\/code>\u51fd\u6570\u5916\uff0cPython\u7684<code>math<\/code>\u5e93\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5176\u4ed6\u6709\u7528\u7684\u4e09\u89d2\u51fd\u6570\u548c\u76f8\u5173\u51fd\u6570\uff0c\u4f8b\u5982<code>math.asin()<\/code>\u3001<code>math.acos()<\/code>\u3001<code>math.atan()<\/code>\u7b49\uff0c\u5b83\u4eec\u5206\u522b\u7528\u4e8e\u8ba1\u7b97\u53cd\u6b63\u5f26\u3001\u53cd\u4f59\u5f26\u548c\u53cd\u6b63\u5207\u503c\u3002<\/p>\n<\/p>\n<p><h4>1. \u53cd\u4e09\u89d2\u51fd\u6570<\/h4>\n<\/p>\n<p><p>\u53cd\u4e09\u89d2\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u4e00\u4e2a\u89d2\u7684\u503c\uff0c\u5b83\u4eec\u7684\u8fd4\u56de\u503c\u662f\u4e00\u4e2a\u4ee5\u5f27\u5ea6\u4e3a\u5355\u4f4d\u7684\u89d2\u5ea6\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u53cd\u6b63\u5f26<\/strong><\/h2>\n<p>value = 1<\/p>\n<p>angle_radians = math.asin(value)<\/p>\n<p>angle_degrees = math.degrees(angle_radians)<\/p>\n<p>print(f&quot;asin(1) = {angle_degrees}\u00b0&quot;)<\/p>\n<h2><strong>\u53cd\u4f59\u5f26<\/strong><\/h2>\n<p>value = 0<\/p>\n<p>angle_radians = math.acos(value)<\/p>\n<p>angle_degrees = math.degrees(angle_radians)<\/p>\n<p>print(f&quot;acos(0) = {angle_degrees}\u00b0&quot;)<\/p>\n<h2><strong>\u53cd\u6b63\u5207<\/strong><\/h2>\n<p>value = 1<\/p>\n<p>angle_radians = math.atan(value)<\/p>\n<p>angle_degrees = math.degrees(angle_radians)<\/p>\n<p>print(f&quot;atan(1) = {angle_degrees}\u00b0&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. math.hypot()\u8ba1\u7b97\u659c\u8fb9\u957f\u5ea6<\/h4>\n<\/p>\n<p><p><code>math.hypot()<\/code>\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u76f4\u89d2\u4e09\u89d2\u5f62\u7684\u659c\u8fb9\u957f\u5ea6\u3002\u5b83\u7684\u53c2\u6570\u662f\u76f4\u89d2\u8fb9\u7684\u957f\u5ea6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u8ba1\u7b97\u659c\u8fb9\u957f\u5ea6<\/strong><\/h2>\n<p>a = 3<\/p>\n<p>b = 4<\/p>\n<p>hypotenuse = math.hypot(a, b)<\/p>\n<p>print(f&quot;The length of the hypotenuse is {hypotenuse}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528numpy\u5e93\u8ba1\u7b97\u4e09\u89d2\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u9664\u4e86Python\u5185\u7f6e\u7684<code>math<\/code>\u5e93\u5916\uff0c<code>numpy<\/code>\u5e93\u4e5f\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u7ec4\u64cd\u4f5c\u3002<code>numpy<\/code>\u5e93\u4e2d\u4e5f\u5305\u542b\u4e86\u4e00\u4e9b\u4e09\u89d2\u51fd\u6570\uff0c\u5b83\u4eec\u7684\u4f7f\u7528\u65b9\u6cd5\u4e0e<code>math<\/code>\u5e93\u4e2d\u7684\u51fd\u6570\u7c7b\u4f3c\uff0c\u4f46<code>numpy<\/code>\u5e93\u7684\u51fd\u6570\u53ef\u4ee5\u76f4\u63a5\u4f5c\u7528\u4e8e\u6570\u7ec4\uff0c\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<\/p>\n<p><h4>1. \u5bfc\u5165numpy\u5e93<\/h4>\n<\/p>\n<p><p>\u9996\u5148\u9700\u8981\u5b89\u88c5\u5e76\u5bfc\u5165<code>numpy<\/code>\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8ba1\u7b97\u6b63\u5f26\u503c\u3001\u4f59\u5f26\u503c\u548c\u6b63\u5207\u503c<\/h4>\n<\/p>\n<p><p><code>numpy<\/code>\u5e93\u4e2d\u7684\u4e09\u89d2\u51fd\u6570\u53ef\u4ee5\u76f4\u63a5\u4f5c\u7528\u4e8e\u6570\u7ec4\uff0c\u8ba1\u7b97\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u89d2\u5ea6\u6570\u7ec4\uff08\u4ee5\u5ea6\u6570\u4e3a\u5355\u4f4d\uff09<\/strong><\/h2>\n<p>angles_degrees = np.array([0, 30, 45, 60, 90])<\/p>\n<h2><strong>\u5c06\u89d2\u5ea6\u6570\u7ec4\u8f6c\u6362\u4e3a\u5f27\u5ea6<\/strong><\/h2>\n<p>angles_radians = np.radians(angles_degrees)<\/p>\n<h2><strong>\u8ba1\u7b97\u6b63\u5f26\u503c<\/strong><\/h2>\n<p>sin_values = np.sin(angles_radians)<\/p>\n<p>print(f&quot;sin({angles_degrees}) = {sin_values}&quot;)<\/p>\n<h2><strong>\u8ba1\u7b97\u4f59\u5f26\u503c<\/strong><\/h2>\n<p>cos_values = np.cos(angles_radians)<\/p>\n<p>print(f&quot;cos({angles_degrees}) = {cos_values}&quot;)<\/p>\n<h2><strong>\u8ba1\u7b97\u6b63\u5207\u503c<\/strong><\/h2>\n<p>tan_values = np.tan(angles_radians)<\/p>\n<p>print(f&quot;tan({angles_degrees}) = {tan_values}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u8ba1\u7b97\u53cd\u4e09\u89d2\u51fd\u6570<\/h4>\n<\/p>\n<p><p>\u540c\u6837\u5730\uff0c<code>numpy<\/code>\u5e93\u4e5f\u63d0\u4f9b\u4e86\u53cd\u4e09\u89d2\u51fd\u6570\uff0c\u7528\u4e8e\u8ba1\u7b97\u89d2\u5ea6\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u503c\u6570\u7ec4<\/strong><\/h2>\n<p>values = np.array([0, 0.5, 1])<\/p>\n<h2><strong>\u8ba1\u7b97\u53cd\u6b63\u5f26<\/strong><\/h2>\n<p>asin_values = np.degrees(np.arcsin(values))<\/p>\n<p>print(f&quot;asin({values}) = {asin_values}\u00b0&quot;)<\/p>\n<h2><strong>\u8ba1\u7b97\u53cd\u4f59\u5f26<\/strong><\/h2>\n<p>acos_values = np.degrees(np.arccos(values))<\/p>\n<p>print(f&quot;acos({values}) = {acos_values}\u00b0&quot;)<\/p>\n<h2><strong>\u8ba1\u7b97\u53cd\u6b63\u5207<\/strong><\/h2>\n<p>atan_values = np.degrees(np.arctan(values))<\/p>\n<p>print(f&quot;atan({values}) = {atan_values}\u00b0&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u8ba1\u7b97\u4e09\u89d2\u51fd\u6570\uff0c\u5305\u62ec\u6807\u51c6\u5e93\u4e2d\u7684<code>math<\/code>\u5e93\u548c\u79d1\u5b66\u8ba1\u7b97\u5e93<code>numpy<\/code>\u3002<strong>\u901a\u8fc7\u5bfc\u5165math\u5e93\u3001\u4f7f\u7528math.sin()\u8ba1\u7b97\u6b63\u5f26\u503c\u3001\u4f7f\u7528math.cos()\u8ba1\u7b97\u4f59\u5f26\u503c\u3001\u4f7f\u7528math.tan()\u8ba1\u7b97\u6b63\u5207\u503c<\/strong>\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u8fdb\u884c\u4e09\u89d2\u51fd\u6570\u7684\u8ba1\u7b97\u3002<strong>\u6b64\u5916\uff0cnumpy\u5e93\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u6570\u7ec4\u64cd\u4f5c\u80fd\u529b\u548c\u66f4\u4e30\u5bcc\u7684\u6570\u5b66\u51fd\u6570<\/strong>\uff0c\u9002\u5408\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u548c\u590d\u6742\u7684\u79d1\u5b66\u8ba1\u7b97\u4efb\u52a1\u3002\u638c\u63e1\u8fd9\u4e9b\u65b9\u6cd5\u548c\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u9ad8\u6548\u5730\u89e3\u51b3\u5b9e\u9645\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u4e09\u89d2\u51fd\u6570\u5e93\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5185\u7f6e\u7684math\u6a21\u5757\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u591a\u79cd\u4e09\u89d2\u51fd\u6570\uff0c\u4f8b\u5982sin\u3001cos\u548ctan\u7b49\u3002\u8981\u4f7f\u7528\u8fd9\u4e9b\u51fd\u6570\uff0c\u9996\u5148\u9700\u8981\u5bfc\u5165math\u6a21\u5757\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">import math\nangle_in_radians = math.radians(30)  # \u5c06\u89d2\u5ea6\u8f6c\u6362\u4e3a\u5f27\u5ea6\nsin_value = math.sin(angle_in_radians)\nprint(sin_value)  # \u8f93\u51fasin(30\u00b0)\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u8ba1\u7b97\u4efb\u610f\u89d2\u5ea6\u7684\u4e09\u89d2\u51fd\u6570\u503c\u3002<\/p>\n<p><strong>Python\u4e2d\u5982\u4f55\u5904\u7406\u89d2\u5ea6\u548c\u5f27\u5ea6\u7684\u8f6c\u6362\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u4e09\u89d2\u51fd\u6570\u901a\u5e38\u4f7f\u7528\u5f27\u5ea6\u5236\u8fdb\u884c\u8ba1\u7b97\u3002\u5982\u679c\u9700\u8981\u4f7f\u7528\u89d2\u5ea6\uff0c\u53ef\u4ee5\u901a\u8fc7math\u6a21\u5757\u4e2d\u7684radians\u51fd\u6570\u8fdb\u884c\u8f6c\u6362\u3002\u4f8b\u5982\uff0c\u5c0645\u5ea6\u8f6c\u6362\u4e3a\u5f27\u5ea6\uff1a<\/p>\n<pre><code class=\"language-python\">angle_in_degrees = 45\nangle_in_radians = math.radians(angle_in_degrees)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fdd\u8bc1\u8ba1\u7b97\u7684\u51c6\u786e\u6027\uff0c\u540c\u65f6\u907f\u514d\u5e38\u89c1\u7684\u9519\u8bef\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u8ba1\u7b97\u53cd\u4e09\u89d2\u51fd\u6570\uff1f<\/strong><br \/>Python\u7684math\u6a21\u5757\u540c\u6837\u63d0\u4f9b\u4e86\u53cd\u4e09\u89d2\u51fd\u6570\uff0c\u4f8b\u5982asin\u3001acos\u548catan\u7b49\u3002\u8fd9\u4e9b\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u8ba1\u7b97\u7ed9\u5b9a\u503c\u7684\u89d2\u5ea6\u3002\u4f8b\u5982\uff0c\u8ba1\u7b97\u6b63\u5f26\u503c\u4e3a0.5\u7684\u89d2\u5ea6\uff1a<\/p>\n<pre><code class=\"language-python\">sin_value = 0.5\nangle_in_radians = math.asin(sin_value)\nangle_in_degrees = math.degrees(angle_in_radians)  # \u8f6c\u6362\u4e3a\u5ea6\nprint(angle_in_degrees)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u4f7f\u5f97\u7528\u6237\u80fd\u591f\u53cd\u5411\u8ba1\u7b97\u89d2\u5ea6\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u5e94\u7528\u573a\u666f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u8ba1\u7b97\u4e09\u89d2\u51fd\u6570\u7684\u65b9\u6cd5\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684\u6570\u5b66\u5e93math\uff0c\u5305\u62ecsin\u3001cos\u3001tan\u7b49\u51fd\u6570\u3002\u9996\u5148\u5bfc\u5165math [&hellip;]","protected":false},"author":3,"featured_media":1054120,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1054115"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1054115"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1054115\/revisions"}],"predecessor-version":[{"id":1054122,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1054115\/revisions\/1054122"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1054120"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1054115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1054115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1054115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}