---
title: "Math commands"
canonical: "https://docs.cuesystem.com/space/CVCHELP/512327770/Math%20commands"
format: markdown
---
> Macro (toc)

---

# ACos

This function is the inverse of the cosinus function. It returns angle (in degrees, 0 <= angle < 360) for which Cos (angle) is equal to x. 

All angles are measured in angular degrees. The positive direction is counter-clockwise. The X-axis goes from left to right. Y-axis goes from bottom to up. 

#### Syntax 

```visualbasic
Function ACos(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value* *

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the angle. 

# ASin

This function is the inverse of the sinus function. It returns angle (in degrees, 0 <= angle < 360) for which Sin (angle) is equal to x. 

All angles are measured in angular degrees. The positive direction is counter-clockwise. The X-axis goes from left to right. Y-axis goes from bottom to up. 

#### Syntax 

```visualbasic
Function ASin(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the angle. 

# ATan

This function is the inverse of the tangent function. It returns angle (in degrees, 0 <= angle < 360) for which Tan (angle) is equal to x. 

All angles are measured in angular degrees. The positive direction is counter-clockwise. The X-axis goes from left to right. Y-axis goes from bottom to up. 

#### Syntax 

```visualbasic
Function ATan(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the angle. 

# ATan2

This function returns the angle of the two-dimensional vector (in degrees), which coordinates are x, and y. 

All angles are measured in angular degrees. The positive direction is counter-clockwise. The X-axis goes from left to right. Y-axis goes from bottom to up. 

#### Syntax 

```visualbasic
Function ATan2( 
  x As Double, 
  y As Double) 
As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on, the vector's coordinate x. 

y 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on, the vector's coordinate y. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the angle. 

# Cos

The function returns the cosine of angle x (in degrees). 

All angles are measured in angular degrees. The positive direction is counter-clockwise. The X-axis goes from left to right. Y-axis goes from bottom to up. 

#### Syntax 

```visualbasic
Function Cos(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the cosine of the angle. 

# GetNaN

The function returns not a number (NaN) floating-point value.  

#### Syntax 

```visualbasic
Function GetNaN() As Double
```

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) Not a number floating-point value. 

# IsNaN

The function checks a given floating-point value for not a number (NaN).  

#### Syntax 

```visualbasic
Function IsNaN(x As Double) As Boolean
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) floating-point value. 

#### Return value 

[<u>Boolean</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean) It is True if the parameter is not a number, False otherwise. 

# Ln 

This function returns the natural logarithm of a number x. 

#### Syntax 

```visualbasic
Function Ln(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the natural logarithm. 

# Log

This function returns the decimal logarithm of a number x. 

#### Syntax 

```visualbasic
Function Log(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the decimal logarithm. 

# Sin

The function returns the sine of angle x (in degrees). 

All angles are measured in angular degrees. The positive direction is counter-clockwise. The X-axis goes from left to right. Y-axis goes from bottom to up. 

#### Syntax 

```visualbasic
Function Sin(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the sine of the angle. 

# Tan

The function returns the tangent of angle x (in degrees). 

All angles are measured in angular degrees. The positive direction is counter-clockwise. The X-axis goes from left to right. Y-axis goes from bottom to up. 

#### Syntax 

```visualbasic
Function Tan(x As Double) As Double
```

#### Parameters 

x 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is a value to be counted on. 

#### Return value 

[<u>Double</u>](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double) It is the tangent of an angle. 

# **_E**

Constant _E (base of the natural logarithm, Euler’s number) is defined in the firmware of units. 

#### Syntax 

```visualbasic
Const _E As Double := 2.7182818284590452353602874713527
```

# _Pi

Constant _Pi (circular constant or Ludolph's number) is defined in the firmware of units. 

#### Syntax 

```visualbasic
Const _Pi As Double := 3.1415926535897932384626433832795
```