TanH()

TanH()

Hyperbolic Tangent of the argument

Syntax

      TANH( nArea ) -> nHyperbolicTangent

Arguments

<nArea> the size of the area (see below)

Returns

<nHyperbolicTangent> the hyperbolic tangent of <nArea>

Description

The function TANH() calculates the hyperbolic tangent of the argument. In analytical mathematics it is defined as SINH(x)/COSH(x).

Examples

      ? tanh( 0.0 ) // --> 0.0
      ? tanh( 1.0 ) // --> 0.7615...

Tests

      tanh( 0.0 ) == 0.0
      tanh( -0.5 ) == -tanh( 0.5 )

Compliance

TANH() is new in Harbours CT3’s library.

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

TAN()

TAN()

Tangent of the argument

Syntax

      TAN( nRadiant ) -> nTangent

Arguments

<nRadiant> an angle size given in radiants

Returns

<nTangent> the tangent of <nRadiant>

Description

The function TAN() calculates the tangent of an angle whose size is given in radiants (full angle equals 2*Pi – see DTOR() for angle size given in degress). A common geometric interpretation of the TAN() function is the counterkathede-ankathede-ratio of a right-angled triangle, or, tan(x) = sin(x)/cos(x).

Examples

      ? tan( 0.0 ) // --> 0.0
      ? tan( 1.0 ) // --> 1.5574...

Tests

      tan( 0.0 ) == 0.0
      tan( PI() / 4 ) == 1
      tan( PI() ) == 0.0

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

SINH()

SINH()

Hyperbolic Sine of the argument

Syntax

      SINH( nArea ) -> nHyperbolicSine

Arguments

<nArea> the size of the area (see below)

Returns

<nHyperbolicSine> the hyperbolic sine of <nArea>

Description

The function SINH() calculates the hyperbolic sine of the argument. In analytical mathematics it is defined as 1/2*(exp(nArea)-exp(-nArea)). A common geometric interpretation of the SINH() function is the maximum y value of the points in the area with the given size <nArea>, that is bound by the x axis, a straight line through the point of origin (this one is fixed by the area) and the hyperbola xˆ2-yˆ2=1.

Examples

      ? sinh( 0.0 ) // --> 0.0
      ? sinh( 1.0 ) // --> 1.1752...

Tests

      sinh( 0.0 ) == 0.0
      sinh( -0.5 ) == -sinh( 0.5 )

Compliance

SINH() is new in Harbours CT3’s library.

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

SIN()

SIN()

Sine of the argument

Syntax

      SIN (nRadiant) -> nSine

Arguments

<nRadiant> an angle size given in radiants

Returns

<nSine> the sine of <nRadiant>

Description

The function SIN() calculates the sine of an angle whose size is given in radiants (full angle equals 2*Pi – see DTOR() for angle size given in degress). A common geometric interpretation of the SIN() function is the counterkathede-hypotenuse-ratio of a right-angled triangle.

Examples

      ? sin( 0.0 ) // --> 0.0
      ? sin( 1.0 ) // --> 0.8414...

Tests

      sin( 0.0 ) == 0.0
      sin( PI() / 4 ) == sqrt( 1 / 2 )
      sin( PI() / 2 ) == 1.0
      sin( PI() ) == 0.0

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

RTOD()

RTOD()

Convert radiant to degree

Syntax

      RTOD( nRadiant ) -> nDegree

Arguments

<nRadiant> the size of an angle in radiant

Returns

<nDegree> the size of that angle in degree

Description

The function RTOD() can be used to convert sizes of angles given in radiant (like those returned by the asin, acos or atan function) to degrees that are commonly used geometry and technics.

Examples

      ? rtod( PI() ) // --> 180
      ? tanh( PI() / 3 ) // --> 60

Tests

      rtod( 0.0 ) == 0.0
      rtod( PI() ) == 180.0

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

DTOR()

DTOR()

Convert degree to radiant

Syntax

      DTOR( nDegree ) -> nRadiant

Arguments

<nDegree> the size of that angle in degree

Returns

<nRadiant> the size of an angle in radiant

Description

The function DTOR() can be used to convert sizes of angles given in degrees to radiant (as expected by sin, cos or tan functions).

Examples

      ? dtor( 180 ) // --> PI()
      ? dtor( 60 ) // --> PI() / 3

Tests

      dtor( 0.0 ) == 0.0
      dtor( 180.0 ) == PI()

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

COT()

COT()

Cotangent of the argument

Syntax

      COT( nRadiant ) -> nCotangent

Arguments

<nRadiant> an angle size given in radiants

Returns

<nCotangent> the cotangent of <nRadiant>

Description

The function COT() calculates the cotangent of an angle whose size is given in radiants (full angle equals 2*Pi – see DTOR() for angle size given in degress). A common geometric interpretation of the COT() function is the ankathede-counterkathede-ratio of a right-angled triangle, or, cot(x) = cos(x)/sin(x)=1/tan(x).

Examples

      ? cot( 1.0 ) // --> 0.6420...

Tests

      cot( PI() / 4 ) == 1
      cot( PI() / 2 ) == 0

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

COSH()

COSH()

Hyperbolic Cosine of the argument

Syntax

      COSH( nArea ) -> nHyperbolicCosine

Arguments

<nArea> the size of the area (see below)

Returns

<nHyperbolicCosine> the hyperbolic cosine of <nArea>

Description

The function COSH() calculates the hyperbolic cosine of the argument. In analytical mathematics it is defined as 1/2*(exp(nArea)+exp(-nArea)). A common geometric interpretation of the COSH() function is the maximum x value of the points in the area with the given size <nArea>, that is bound by the x axis, a straight line through the point of origin (this one is fixed by the area) and the hyperbola xˆ2-yˆ2=1.

Examples

      ? cosh( 0.0 ) // --> 1.0
      ? cosh( 1.0 ) // --> 1.5430...

Tests

      cosh( 0.0 ) == 1.0
      cosh( -0.5 ) == cosh( 0.5 )

Compliance

COSH() is new in Harbours CT3’s library.

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

COS()

COS()

Cosine of the argument

Syntax

      COS( nRadiant ) -> nCosine

Arguments

<nRadiant> an angle size given in radiants

Returns

<nCosine> the cosine of <nRadiant>

Description

The function COS() calculates the cosine of an angle whose size is given in radiants (full angle equals 2*Pi – see DTOR() for angle size given in degress). A common geometric interpretation of the COS() function is the ankathede-hypotenuse-ratio of a right-angled triangle.

Examples

      ? cos( 0.0 ) // --> 1.0
      ? cos( 1.0 ) // --> 0.5403...

Tests

      cos( 0.0) == 1.0
      cos( PI() / 4 ) == sqrt( 1 / 2 )
      cos( PI() / 2 ) == 0.0
      cos( PI() ) == -1.0

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

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