EGXPhys

Functions

template<typename T >
EGXMath::SawtoothWave (const T &x, const T &period)
 Sawtooth wave function. Periodic function with a perodicity of \(T\). Values range from -1 to 1.

\[sawtooth(x)=2(\frac{x}{T} - floor(\frac{x}{T} + \frac{1}{2}))\]

. More...

 
template<typename T >
EGXMath::SquareWave (const T &x, const T &period)
 Square wave function. Periodic function with a perodicity of \(T\). Values range from -1 to 1.

\[square(x)= sign( sin (\frac{2 \pi x}{T})) \]

. More...

 
template<typename T >
EGXMath::TriangleWave (const T &x, const T &period)
 Triangle wave function. Periodic function with a perodicity of \(T\). Values range from -1 to 1.

\[triangle(x)= \frac{4}{T}(x-\frac{T}{2} floor(\frac{2 x}{T}+\frac{1}{2}) )(-1)^{floor(\frac{2 x}{T}+\frac{1}{2})} \]

. More...

 
template<typename T >
EGXMath::HeavisideStep (const T &x)
 Heaviside step function. Values range from 0 to 1.

\[H(x)=\begin{cases} 0, & x < 0, \\ 1, & x \ge 0, \end{cases} \]

. More...

 

Detailed Description

Function Documentation

◆ HeavisideStep()

template<typename T >
T EGXMath::HeavisideStep ( const T &  x)

Heaviside step function. Values range from 0 to 1.

\[H(x)=\begin{cases} 0, & x < 0, \\ 1, & x \ge 0, \end{cases} \]

.

See http://mathworld.wolfram.com/HeavisideStepFunction.html and https://en.wikipedia.org/wiki/Heaviside_step_function

Parameters
x\(x\ (dimensionless)\) is the argument of the function.
Returns
\(H(x)\ (dimensionless)\) the value of the heaviside step function at x. Ranges from -1 to 1 with a periodicity of period.
See also
SawtoothWave() for sawtooth wave function.
SquareWave() for square wave function.
TriangleWave() for triangle wave function.

◆ SawtoothWave()

template<typename T >
T EGXMath::SawtoothWave ( const T &  x,
const T &  period 
)

Sawtooth wave function. Periodic function with a perodicity of \(T\). Values range from -1 to 1.

\[sawtooth(x)=2(\frac{x}{T} - floor(\frac{x}{T} + \frac{1}{2}))\]

.

See http://mathworld.wolfram.com/SawtoothWave.html and https://en.wikipedia.org/wiki/Sawtooth_wave

Parameters
x\(x\ (dimensionless)\) is the argument of the function.
period\(T\ (dimensionless)\) is the period of the periodic function. After how much should the function repeate.
Returns
\(sawtooth(x)\ (dimensionless)\) the value of the sawthooth wave function at x. Ranges from -1 to 1 with a periodicity of period.
See also
SquareWave() for square wave function.
TriangleWave() for triangle wave function.
HeavisideStep() for heaviside step function.

◆ SquareWave()

template<typename T >
T EGXMath::SquareWave ( const T &  x,
const T &  period 
)

Square wave function. Periodic function with a perodicity of \(T\). Values range from -1 to 1.

\[square(x)= sign( sin (\frac{2 \pi x}{T})) \]

.

See http://mathworld.wolfram.com/SquareWave.html and https://en.wikipedia.org/wiki/Square_wave

Parameters
x\(x\ (dimensionless)\) is the argument of the function.
period\(T\ (dimensionless)\) is the period of the periodic function. After how much should the function repeate.
Returns
\(square(x)\ (dimensionless)\) the value of the square wave function at x. Ranges from -1 to 1 with a periodicity of period.
See also
SawtoothWave() for sawtooth wave function.
TriangleWave() for triangle wave function.
HeavisideStep() for heaviside step function.

◆ TriangleWave()

template<typename T >
T EGXMath::TriangleWave ( const T &  x,
const T &  period 
)

Triangle wave function. Periodic function with a perodicity of \(T\). Values range from -1 to 1.

\[triangle(x)= \frac{4}{T}(x-\frac{T}{2} floor(\frac{2 x}{T}+\frac{1}{2}) )(-1)^{floor(\frac{2 x}{T}+\frac{1}{2})} \]

.

See http://mathworld.wolfram.com/TriangleWave.html and https://en.wikipedia.org/wiki/Triangle_wave

Parameters
x\(x\ (dimensionless)\) is the argument of the function.
period\(T\ (dimensionless)\) is the period of the periodic function. After how much should the function repeate.
Returns
\(triangle(x)\ (dimensionless)\) the value of the triangle wave function at x. Ranges from -1 to 1 with a periodicity of period.
See also
SawtoothWave() for sawtooth wave function.
SquareWave() for square wave function.
HeavisideStep() for heaviside step function.