fennec
Loading...
Searching...
No Matches
Trigonometry

The Trigonometric Functions defined in the OpenGL 4.6 Shading Language Specification.

the Trigonometry

Angle Conversions

Syntax Description

genFType degrees(genFType x)

Converts \(radians\) to \(degrees\), i.e., \(radians\cdot\frac{\pi}{180}\).

Returns
the angle \(\theta\) in \(degrees\)

Converts \(radians\) to \(degrees\), i.e., \(radians\cdot\frac{\pi}{180}\)

Template Parameters
genTypefloating point type
Parameters
radiansthe angle \(\theta\) in \(radians\)

genFType radians(genFType x)

Converts \(degrees\) to \(radians\), i.e., \(degrees\cdot\frac{180}{\pi}\).

Returns
the angle \(\theta\) in \(radians\)

Converts \(degrees\) to \(radians\), i.e., \(degrees\cdot\frac{180}{\pi}\)

Template Parameters
genTypefloating point type
Parameters
degreesthe angle \(\theta\) in \(degrees\)

Trigonometric Functions

Syntax Description

genFType sin(genFType x)

The standard trigonometric sine.

Returns
the sine of \(\theta\) in the range \(\left[-1,\,1\right]\)

The standard trigonometric sine

Template Parameters
genTypefloating point type
Parameters
xthe angle \(\theta\) in \(radians\)

genFType cos(genFType x)

The Standard Trigonometric Cosine.

Returns
the cosine of \(\theta\) in the range \(\left[-1,\,1\right]\)

The Standard Trigonometric Cosine

Template Parameters
genTypefloating point type
Parameters
xthe angle \(\theta\) in \(radians\)

genFType tan(genFType x)

The Standard Trigonometric Tangent.

Returns
The Tangent of \(\theta\) in the Range \(\left[-\inf,\,\inf\right]\)

The Standard Trigonometric Tangent

Template Parameters
genTypefloating point type
Parameters
xThe Angle \(\theta\) in \(radians\)

genFType asin(genFType x)

Arc Sine. Returns an angle \(\theta\) whose sine is /a x.

Returns
an angle \(\theta\) whose sine is /a x.

Arc Sine. The range of values returned by this functions is \(\left[-\pi/2,\pi/2\right]\). Results are undefined if \(\left|x\right|\,>\,1\).

Template Parameters
genTypefloating point type
Parameters
xThe Sine Value produced by \(\theta\)

genFType acos(genFType x)

Arc Cosine. Returns an angle \(\theta\) whose cosine is /a x.

Returns
an angle \(\theta\) whose cosine is /a x.

Arc Cosine. The range of values returned by this functions is \(\left[0,\pi\right]\). Results are undefined if \(\left|x\right|\,>\,1\).

Template Parameters
genTypefloating point type
Parameters
xThe Cosine Value produced by \(\theta\)

genFType atan(genFType x)

Arc Tangent. Returns an angle \(\theta\) whose tangent is /a y_over_x.

Returns
an angle \(\theta\) whose tangent is /a y_over_x.

Arc Tangent. The range of values returned by this functions is \(\left[\frac{-\pi}{2},\frac{\pi}{2}\right]\). Results are undefined if \(\left|x\right|\,>\,1\).

Template Parameters
genTypefloating point type
Parameters
y_over_xThe Cosine Value produced by \(\theta\)

Hyperbolic Functions

Syntax Description

genFType sinh(genFType x)

Returns the Hyperbolic Sine Function, \(\frac{{e}^{x}-{e}^{-x}}{2}\).

Returns
The Hyperbolic Sine of \(x\), \(\frac{{e}^{x}-{e}^{-x}}{2}\)

Template Parameters
genTypefloating point type
Parameters
xThe Hyperbolic Angle \(\alpha\)

genFType cosh(genFType x)

Returns the Hyperbolic Cosine Function, \(\frac{{e}^{x}+{e}^{-x}}{2}\).

Returns
The Hyperbolic Cosine of \(x\), \(\frac{{e}^{x}+{e}^{-x}}{2}\)

Parameters
xThe Hyperbolic Angle \(\alpha\)

genFType tanh(genFType x)

Returns the Hyperbolic Tangent Function, \(\frac{\text{sinh}(x)}{\text{cosh}(x)}\).

Returns
The Hyperbolic Tangent of \(x\), \(\frac{{e}^{x}+{e}^{-x}}{2}\)

Parameters
xThe Hyperbolic Angle \(\alpha\)

genFType asinh(genFType x)

The Inverse Hyperbolic Sine Function.

Returns
the value \(y\) that fulfills \(x=\text{sinh}(y)\)

The Inverse Hyperbolic Sine Function

Parameters
xthe hyperbolic angle \(\alpha\)

genFType acosh(genFType x)

The Inverse Hyperbolic Cosine Function.

Returns
the value \(y\) that fulfills \(x=\text{cosh}(y)\)

The Inverse Hyperbolic Cosine Function

Parameters
xthe hyperbolic angle \(\alpha\)

genFType atanh(genFType x)

The Inverse Hyperbolic Tangent Function.

Returns
the value \(y\) that fulfills \(x=\text{atanh}(y)\)

The Inverse Hyperbolic Tangent Function

Parameters
xThe Hyperbolic Angle \(\alpha\)