FNXY – Evaluation of two-variables function

Block SymbolLicensing group: STANDARD

Function Description
The FNXY block evaluates basic math functions of two variables. The table below shows the list of supported functions with corresponding constraints. The ifn parameter determines the active function.
List of functions:

 ifn: shortcut function constraints on u1, u2 1: atan2 arctangent $\mathtt{\text{u1}}∕\mathtt{\text{u2}}$ – 2: fmod remainder after division $\mathtt{\text{u1}}∕\mathtt{\text{u2}}$ $\mathtt{\text{u2}}\ne 0.0$ 3: pow exponentiation of the inputs $\mathtt{\text{y}}={\mathtt{\text{u1}}}^{\mathtt{\text{u2}}}$ –

The atan2 function result belongs to the interval $⟨-\pi ,\pi ⟩$. The signs of both inputs u1 a u2 are used to determine the appropriate quadrant.

The fmod function computes the remainder after division $\mathtt{\text{u1}}∕\mathtt{\text{u2}}$ such that $\mathtt{\text{u1}}=i\cdot \mathtt{\text{u2}}+\mathtt{\text{y}}$, where $i$ is an integer, the signs of the y output and the u1 input are the same and the following holds for the absolute value of the y output: $|\mathtt{\text{y}}|<|\mathtt{\text{u2}}|$.

The error output is activated ($\mathtt{\text{E}}=\mathtt{\text{on}}$) in the case when the input value u2 does not meet the constraints or an error occurs during evaluation of the selected function (implementation dependent), e.g. division by zero. The output is set to substitute value in such case ($\mathtt{\text{y}}=\mathtt{\text{yerr}}$).

Inputs

 ifn Function type (see the table above)  $\odot$1 Long (I32) 1 .... atan2 2 .... fmod 3 .... pow yerr Substitute value for an error case Double (F64)