ACOS
- 来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgAcos
- 最后更新: 2018-04-16
求一个角的反余弦值
语法
declare function Acos ( byval number as double ) as double用法
result = Acos( number )参数
number
余弦值,范围为 [-1..1]。
返回值
number 的反余弦值,以弧度表示,范围为 [0..Pi]。
说明
Acos 返回参数 number 的反余弦值,结果为 Double 类型,范围在 0 到 Pi 之间。反余弦是 Cos 函数的逆运算。返回的角度以弧度表示(非度数)。
Acos 可作为运算符重载,以接受用户自定义类型。
示例
vb
Dim h As Double
Dim a As Double
Input "Please enter the length of the hypotenuse of a triangle: ", h
Input "Please enter the length of the adjacent side of the triangle: ", a
Print ""
Print "The angle between the sides is"; Acos ( a / h )
Sleep输出结果如下:
Please enter the length of the hypotenuse of a triangle: 5
Please enter the length of the adjacent side of the triangle: 4
The angle between the sides is 0.6435011087932843方言差异
- 在 -lang qb 方言中不可用,除非使用别名
__Acos引用。
与 QB 的差异
- FreeBASIC 新增
另请参阅
Cos- 三角函数简介
返回 目录