ATN2()

ATN2()

Arcus tangent a sine and a cosine argument

Syntax

      ATN2( nSine, nCosine ) -> nRadiant

Arguments

<nSine> the sine of an angle <nCosine> the cosine of an angle

Returns

<nRadiant> the angle whose tangent is <nSine>/<nCosine>

Description

The function ATN2() is an alternate function for calculating the arcus tangent, atn2(x, y) = atan(x/y). It takes two arguments, the sine and the cosine of the angle that should be calculated. Thus, in contrast to the ATAN() function, ATN2() can distinguish whether the sine or the cosine has a negative sign (or both being positive or negative), so that the return value can be between -PI() and PI() and covers the full angle. The return value is given in radiants (full angle equals 2*Pi – see DTOR() if you need to convert it into degress).

Examples

      ? atn2( 0.0, 1.0 ) // --> 0.0
      ? atn2( sqrt( 1 / 2 ), sqrt( 1 / 2 ) ) // --> PI() / 4

Tests

      atn2( 0.0, 1.0 ) == 0.0
      atn2( sqrt( 1 / 2 ), sqrt( 1 / 2 ) ) == PI() / 4
      atn2( -sqrt( 1 / 2 ), -sqrt( 1 / 2 ) ) == -3 / 4 * PI()  // atan() would return PI() / 4 !

Compliance

ATN2() is compatible with CT3’s ATN2().

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

SIN(), COS(), TAN(), COT(), ASIN(), ACOS(), ATAN(), SINH(), COSH(), TANH(), RTOD(), DTOR(), PI()

ATAN()

ATAN()

Arcus tangent of the argument

Syntax

      ACOS( nTangent ) -> nRadiant

Arguments

<nTangent> the tangent of an angle

Returns

<nRadiant> the angle whose tangent is <nTangent>

Description

The function ATAN() is the inverse function of TAN(). It takes a tangent value and returns the smallest(!) angle whose tangent equals to the argument. The return value is given in radiants between -PI()/2 and PI()/2 (full angle equals 2*Pi – see DTOR() if you need to convert it into degress).

Examples

      ? atan( 0.0 ) // --> 0.0
      ? atan( 0.5 ) // --> 0.4636...

Tests

      atan( 0.0 ) == 0.0
      atan( 1.0 ) == PI() / 4
      atan( 0.0 ) == 0.0 // and not PI(), although tan( PI() ) == 0.0 !

Compliance

ATAN() is compatible with CT3’s ATAN().

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

SIN(), COS(), TAN(), COT(), ASIN(), ACOS(), ATAN(), SINH(), COSH(), TANH(), RTOD(), DTOR(), PI()

ASIN()

ASIN()

Arcus sine of the argument

Syntax

      ASIN( nSine ) -> nRadiant

Arguments

<nSine> the sine of an angle

Returns

<nRadiant> the angle whose sine is <nSine>

Description

The function ASIN() is the inverse function of SIN(). It takes a sine value and returns the smallest(!) angle whose sine equals to the argument. The return value is given in radiants (full angle equals 2*Pi – see DTOR() if you need to convert it into degress). Note, that <nSine> must be between -1 and 1 and that <nRadiant> is always between -PI()/2 and PI()/2.

Examples

      ? asin( 0.0 ) // --> 0.0
      ? asin( 0.5 ) // --> 0.5235...

Tests

      asin( 0.0 ) == 0.0
      asin( sqrt( 1 / 2 ) ) == PI() / 4
      asin( 1.0 ) == PI() / 2
      asin( 0.0 ) == 0.0  // and not PI(), since the smallest angle is returned !

Compliance

ASIN() is compatible with CT3’s ASIN().

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

SIN(), COS(), TAN(), COT(), ACOS(), ATAN(), ATN2(), SINH(), COSH(), TANH(), RTOD(), DTOR(), PI()

CT_ACOS

 ACOS()
 Computes the cosine arc
------------------------------------------------------------------------------
 Syntax

     ACOS(<nCosine>) --> nCosArc

 Argument

     <nCosine>  Designates the cosine value for an angle where the
     response is determined in radians.  The value is in the range of -1 to
     +1 (inclusive).

 Returns

     ACOS() returns the cosine arc for <nCosine>.

 Description

     ACOS() determines an angle size in radians for a cosine value.  The
     returned value is in the range of 0 to pi.

 Note

     .  The precision of the result can be influenced by the SETPREC()
        function.

 Example

     Compute the cosine arc:

     ? STR(ACOS(0.7), 18, 15)      // 0.795398830184144

See Also: ASIN() ATAN() ATN2() DTOR() RTOD() SETPREC() SIN() TAN()

 

Tools — Mathematical Functions

Introduction Mathematical Functions
ACOS()    Computes the cosine arc
ASIN()    Computes the sine arc
ATAN()    Computes the tangent arc
ATN2()    Computes the angle size from the sine and cosine
CEILING() Rounds up to the next integer
COS()     Computes the cosine
COT()     Computes the cotangent
DTOR()    Converts from a degree to radian measure
FACT()    Computes the factorial
FLOOR()   Rounds down to the next integer
FV()      Computes future value of capital
GETPREC() Determines the level of precision that is set
LOG10()   Computes the common logarithm
PAYMENT() Computes the periodic payment amount
PERIODS() Computes number of payment periods necessary to repay a loan
PI()      Returns pi with the highest degree of accuracy
PV()      Computes the cash present value after interest charges
RATE()    Computes the interest rate for a loan
RTOD()    Converts from a radian to degree measure
SETPREC() Sets the precision level for trigonometric functions
SIGN()    Determines the mathematical sign of a number
SIN()     Computes the sine of a radian value
TAN()     Computes the tangent of a radian value