用Python计算三角函数之atan()方法的使用

作者:goldensun 时间:2023-06-22 22:26:00 

 atan()方法返回x的反正切值,以弧度表示。
Syntax

以下是atan()方法的语法:

atan(x)

注意:此函数是无法直接访问的,所以我们需要导入math模块,然后需要用math的静态对象来调用这个函数。
参数

  •     x -- 这必须是一个数值。

返回值

此方法返回 x 的反正切值,以弧度表示。
例子

下面的例子显示atan()方法的使用。


#!/usr/bin/python
import math

print "atan(0.64) : ", math.atan(0.64)
print "atan(0) : ", math.atan(0)
print "atan(10) : ", math.atan(10)
print "atan(-1) : ", math.atan(-1)
print "atan(1) : ", math.atan(1)

当我们运行上面的程序,它会产生以下结果:


atan(0.64) : 0.569313191101
atan(0) : 0.0
atan(10) : 1.4711276743
atan(-1) : -0.785398163397
atan(1) : 0.785398163397

标签:Python
0
投稿

猜你喜欢

  • python如何实现一个刷网页小程序

    2022-12-09 15:45:56
  • python滑块验证码的破解实现

    2023-11-27 11:46:17
  • php获取referer防非法访问

    2023-08-20 11:30:58
  • XML HttpRequst对象学习

    2007-10-12 19:04:00
  • python创建和使用字典实例详解

    2021-06-11 11:37:06
  • PHP设计模式之解释器模式浅析

    2023-05-29 02:28:16
  • Flask wtforms实现表单验证使用

    2021-12-16 05:04:27
  • ASP+ajax注册即时提示程序代码

    2011-02-05 11:25:00
  • mysql遇到load data导入文件数据出现1290错误的解决方案

    2024-01-29 09:53:12
  • python 通过logging写入日志到文件和控制台的实例

    2021-04-26 00:04:38
  • python使用pytest接口自动化测试的使用

    2022-06-15 05:23:48
  • 在Linux系统上部署Apache+Python+Django+MySQL环境

    2024-01-14 00:51:15
  • 利用Python实现端口扫描器的全过程

    2021-07-08 01:25:32
  • 判断目标是否是window,document,和拥有tagName的Element的代码

    2024-04-16 08:46:46
  • Python requests发送post请求的一些疑点

    2022-09-09 17:45:03
  • Python3 能振兴 Python的原因分析

    2021-01-11 06:44:12
  • 将python文件打包成EXE应用程序的方法

    2022-07-09 16:01:12
  • Python实现两种多分类混淆矩阵

    2022-03-01 13:58:32
  • MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM

    2024-01-27 16:55:14
  • Python数据分析之 Matplotlib 饼图绘制

    2021-03-31 03:45:10
  • asp之家 网络编程 m.aspxhome.com