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()

ACOS()

ACOS()

Arcus cosine of the argument

Syntax

      ACOS( nCosine ) -> nRadiant

Arguments

<nCosine> the cosine of an angle

Returns

<nRadiant> the angle whose cosine is <nCosine>

Description

The function ACOS() is the inverse function of COS(). It takes a cosine value and returns the smallest(!) angle whose cosine 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 <nCosine> must be between -1 and 1 and that <nRadiant> is always between 0 and PI().

Examples

      ? acos( 0.0 ) // --> PI() / 2
      ? acos( 0.5 ) // --> 1.04719...

Tests

      acos( 0.0 ) == PI() / 2
      acos( sqrt( 1 / 2 ) ) == PI() / 4
      acos( 1.0 ) == 0.0
      acos( -1.0 ) == PI()
      acos( 0.0 ) == PI() / 2  // and not -PI()/2, although cos (-PI()/2) == 0.0 !

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

CT_ATN2

 ATN2()
 Computes the angle size from the sine and cosine
------------------------------------------------------------------------------
 Syntax

     ATN2(<nSine>,<nCosine>) --> nArc

 Arguments

     <nSine>  Designates the sine value for an angle.

     <nCosine>  Designates the cosine value for an angle.

 Returns

     ATN2() returns the angle sine in radians.

 Description

     ATN2() returns the angle sine in radians, where the sine and the cosine
     of a given point have been specified.  The function returns results for
     all four quadrants and corresponds to a call of ATAN(x/y).  One
     advantage of the ATN2() function is that no "divide by zero" error can
     occur.  The returned value is in the range of -pi to +pi.

 Note

     .  The SETPREC() function can influence the precision of the
        result.

 Examples

     .  Compute the sine and cosine of 30 degrees.  DTOR() is then
        used to convert these into the radian value:

        SET DECIMALS TO 4
        X  :=  SIN(DTOR(30))
        Y  :=  COS(DTOR(30))

     .  Use RTOD() to compute the result in degrees:

        ? RTOD(ATN2(x, y))         // 30.0000

See Also: ASIN() ACOS() ATAN() 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