Table of Contents

ACOS

Returns the arc-cosine of a number given as an argument from -1 to 1

Implemented by: ansifull, bw32, FreeBASIC, Gambas, minibasicmm

With variations:

Also written as:

Usage

PRINT ACOS(0.9)

Comments

The arc-cosine is the inverse function of the cosine trigonometric function. It is the length of the arc whose cosine is its argument, and, as a proportion from 0 to 1 of the circle radius, this is the same as the angle, in radians, whose cosine is the argument.

The arc-cosine function can only result in real values if given a value in the range of -1 to 1; a runtime error will happen otherwise.

The BASIC Cookbook points out that BASICs which don't implement the function can achieve the same results, for a given X argument, with the following formula:

ATN(X/SQR(X*X+1)) + 1.5708

Similar keywords

In other languages...

References