# Mathematical Functions

Various trigonometric, Bessel and miscellaneous functions are built into Feko to help construct geometry, expressions and calculate parameters.

## Trigonometric Functions

The following trigonometric functions are supported:

SIN | sine (argument in radians) |

COS | cosine (argument in radians) |

TAN | tangent (argument in radians) |

COT | cotangent (argument in radians) |

ARCSIN | arcsine (argument in radians) |

ARCCOS | arccosine (argument in radians) |

ARCTAN | arctangent (in radians) |

ATAN2 | This function has two arguments atan2(#y,#x) - it yields arctan(#y/#x) in the range $-\pi \mathrm{...}\pi $ |

ARCCOT | arccotangent |

SINH | hyperbolic sine |

COSH | hyperbolic cosine |

TANH | hyperbolic tangent |

## Bessel Functions

The following Bessel functions are supported:

BESJ(n,x) | Bessel function J_{n}(x) of integer order
$n\ge 0$
and real argument x. |

BESY(n,x) | Neumann function Y_{n}(x) of integer order
$n\ge 0$
and real argument x |

BESI(n,x) | Modified Bessel function of the first kind I_{n}(x) of
integer order
$n\ge 0$
and real argument x |

BESK(n,x) | Modified Bessel function of the second kind K_{n}(x) of
integer order
$n\ge 0$
and real argument x |

## Miscellaneous Functions

SQRT | Square root |

LOG | Logarithm to base 10. |

LN | Natural logarithm |

EXP | Exponential function |

ABS | Absolute value |

DEG | Convert radians into degrees. |

RAD | Convert degrees into radians. |

STEP | Step function, `STEP(x) = 0` for
$x\le 0$
and `STEP(x) = 1`
for x > 0. |

CEIL | Smallest integer value that is equal to or greater than the argument. |

FLOOR | Largest integer value that is equal to or smaller than the argument. |

MAX | Returns the largest of the two arguments — called as
`max(#a,#b)` . |

MIN | Returns the smallest of the two arguments — called as
`min(#a,#b)` . |

FMOD | This function has two arguments `fmod(#a,#b)`
and returns the remainder of the division
`#a/#b` . |

RANDOM | This function returns a random value in the range 0 . . . 1.
If the argument `X` of
RANDOM() is -1, then a random number is returned.
For any other argument |

Coordinate functions provide access to the individual X coordinate, Y coordinate and Z coordinate of a Cartesian coordinate in 3D space.

## Coordinate Functions

The following coordinate functions are supported:X_COORD | This function returns the X coordinate of a point previously defined by a DP card. |

Y_COORD | This function returns the Y coordinate of a point previously defined by a DP card. |

Z_COORD | This function returns the Z coordinate of a point previously defined by a DP card. |

`#x`equal to 1.234.

```
DP PNT01 1.234 0.4567 #z
#x = x_coord("PNT01")
```