Skip to content

ACOS


求一个角的反余弦值

语法

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 新增

另请参阅

返回 目录

基于 FreeBASIC 官方文档翻译 如有侵权请联系我们删除
FreeBASIC 是开源项目,与微软公司无隶属关系