Skip to content
Paul Squires edited this page Oct 19, 2026 · 3 revisions

Home › Mathematical Functions › Acos

Acos

Returns the angle in radians, from 0 to pi, whose cosine is the number.

Syntax

Declare Function Acos ( ByVal number As Double ) As Double

Parameters

  • number

Description

Acos returns the arccosine of the argument number as a Double within the range of 0 to Pi. The arccosine is the inverse of the Cos function. The returned angle is measured in radians (not degrees).

Acos can be overloaded as operator to accept user-defined types.

Return Value

The arccosine of number, in radians, in the range [0..Pi].

Remarks

Usage

result = Acos( number )

Dialect Differences

  • Not available in the -lang qb dialect unless referenced with the alias __Acos.

Differences from QB

  • New to FreeBASIC

See also

Examples

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

The output would look like:

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

Category: Mathematical Functions
Kind: function


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally