Purpose
Returns the arc-cosine value of a number. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Acos ( num_expr )
num_expr is a numeric expression between one and negative one, inclusive.
Return Value
Float
Description
The Acos() function returns the arc-cosine of the numeric num_expr value. In other words, Acos() returns the angle whose cosine is equal to num_expr.
The result returned from Acos() represents an angle, expressed in radians. This angle will be somewhere between zero and Pi radians (given that Pi is equal to approximately 3.141593, and given that Pi/2 radians represents 90 degrees).
To convert a degree value to radians, multiply that value by DEG_2_RAD. To convert a radian value into degrees, multiply that value by RAD_2_DEG. Your program must Include MAPBASIC.DEF in order to reference DEG_2_RAD or RAD_2_DEG.
Since cosine values range between one and negative one, the expression num_expr should represent a value no larger than one and no smaller than negative one.
Example
Include "MAPBASIC.DEF"
Dim x, y As Float
x = 0.5
y = Acos(x) * RAD_2_DEG
' y will now be equal to 60,
' since the cosine of 60 degrees is 0.5
See Also:
Asin() function, Atn() function, Cos() function, Sin() function, Tan() function