ArcCos

Category: Arithmetics
Since engine version: 4.9.1.0 GWE

Description

Calculates arc cosine of iVal/iRadius, or x = arccos(iVal/iRadius). This corresponds to cos(x) = iVal/iRadius. This function is used to calculate an angle from horizontal and vertical offsets. However, in most cases Angle() does what you need.

Syntax

int ArcCos (int iVal, int iRadius);

Parameters

iVal:
Length of the adjacent leg
iRadius:
Length of hypotenuse

Example

Log("Zielwinkel: %d Grad", ArcCos(Abs(GetX(target)-GetX()), ObjectDistance(target)));
Returns the target angle from the object to the target.
See also: Angle, ArcSin, Cos
Sven2, November 2001