ArcSin

Category: Arithmetics
Since engine version: 4.9.1.0 GWE

Description

Calculates arc sine of iVal/iRadius, or x = arcsin(iVal/iRadius). This corresponds to sin(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 ArcSin (int iVal, int iRadius);

Parameters

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

Example

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