Table of Contents

Wiki > TV3D65 Index > TVMathLibrary

ATan2

DESCRIPTION

Calculates the ATan2 of a two arguments x,y. The ATan2 function is Arc Tangent or the Inverse Tangent that distinguishes between opposite directions.

DECLARATION

VB.NET ATan2(fY As Single , fX As Single) As Single
C++ float ATan2(float fY , float fX )

PARAMETERS

NAMEOPTIONALDESCRIPTION
fYNofY parameter (or Y coordinate)
fXNofX parameter (or X coordinate)

RETURN VALUE

Single ATan2 value (in radians or degrees) of fX, fY. Value is in interval (-pi;pi> or (-180;180>

EXAMPLES

ExampleBasic example

TIPS

  • Notice reverse order of arguments fY, fX.
  • This function can be used to obtain angle from direction vector.
  • To change return format between degrees and radians use SetAngleSystem of TVEngine.
 
tvmathlibrary/atan2.txt · Last modified: 2010/05/06 11:38 by 129.215.4.130