> For the complete documentation index, see [llms.txt](https://hyundai-robotics.gitbook.io/hi6-robot-language/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hyundai-robotics.gitbook.io/hi6-robot-language/rl-english/basic-syntax/function/func-math.md).

# 2.9.1 Math Functions

| Function                     | Description                                                                                                                                                       | Example of usage                                                                  | Result                   |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------ |
| abs(**a**)                   | Returns the absolute value of **a**                                                                                                                               | abs(-300)                                                                         | 300                      |
| acos(**a**)                  | Returns the arc cosine value of **a** in radian format                                                                                                            | acos(0.5)                                                                         | 1.0472                   |
| asin(**a**)                  | Returns the arc sine value of **a** in radian format                                                                                                              | asin(0.5)                                                                         | 0.5236                   |
| atan(**a**)                  | Returns the arctangent value of **a** in radian format                                                                                                            | atan(0.5)                                                                         | 0.4636                   |
| atan2(**a**, **b**)          | Returns the arctangent value of a triangle with **a** for the y length and **b** for the x length in radian format                                                | atan2(2,1)                                                                        | 1.1071                   |
| cos(**r**)                   | Returns the cosine value of **r** in radian format                                                                                                                | cos(3.1415)                                                                       | -1                       |
| deg2rad(**d**)               | Returns the radian value of **d** in degree format                                                                                                                | deg2rad(-90)                                                                      | -1.570796                |
| dist(**x**, **y**)           | Returns the Euclidean distance from the origin to the (**x**, **y**) coordinate                                                                                   | dist(3.5,10)                                                                      | 10.59481                 |
| max(**a**, **b**)            | Returns the greater value between **a** and **b**                                                                                                                 | max(-1.23, -3)                                                                    | -1.23                    |
| min(**a**, **b**)            | Returns the lesser value between **a** and **b**                                                                                                                  | max(-1.23, -3)                                                                    | -3                       |
| near(**a**, **b** \[,**e**]) | Returns 1 if the difference between the real number values ​​ **a** and **b** is less than or equal to **e** and returns 0 if the difference is larger than **e** | <p>near(0.005, 0.0058)</p><p>near(0.005, 0.006)</p><p>near(0.005, 0.006, 0.1)</p> | <p>1</p><p>0</p><p>1</p> |
| rad2deg(**r**)               | Returns the degree value of **r** in radian format                                                                                                                | rad2deg(1.570796)                                                                 | 90                       |
| sin(**r**)                   | Returns the sine value of **r** in radian format                                                                                                                  | sin(1.5\*3.1415)                                                                  | -1                       |
| sqr(**a**)                   | Returns the square root of **a**                                                                                                                                  | <p>sqr(16)</p><p>sqr(0)</p>                                                       | <p>4</p><p>0</p>         |
| tan(**r**)                   | Returns the tangent value of **r** in radian format                                                                                                               | tan(3.141592/4)                                                                   | 0.9999                   |
