# 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

Returns

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

Returns

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

Syntax

`      RTOD( nRadiant ) -> nDegree`

Arguments

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

# PI()

### PI()

Returns Pi, the perimeter-to-diameter-ratio of a circle

Syntax

`      PI() -> nPi`

Returns

<nPi> the math constant Pi with maximum precision available

Description

The function PI() can be used if the constant Pi is needed with maximum precision. One of the most known interpretations of this number is the constant perimeter-to-diameter-ratio of circles.

Examples

```      // the diameter of a circle-like swimming pool is 3.4 meters, how
// long is the perimeter ?

? Str( PI() * 3.4, 5, 3 ) + " meters" // --> 10.681 meters```

Compliance

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

Platforms

All

Files

Source is trig.c, library is libct.

Seealso

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

# DTOR()

### DTOR()

Syntax

`      DTOR( nDegree ) -> nRadiant`

Arguments

<nDegree> the size of that angle in degree

Returns

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

Returns

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

# COS()

### COS()

Cosine of the argument

Syntax

`      COS( nRadiant ) -> nCosine`

Arguments

Returns

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