User guide

37
VTB USER GUIDE
8.8 ATAN2
It's similar to atan but it returns a value from -π and +π .
Hardware All
Syntax
Atan2 (y, x) as float
The arguments y and x are of type FLOAT.
Return Value
The return value coincides with the angle whose tangent is y / x.
Example
Used variables:
x float
y float
angle float
radians float
result float
PI float
PI= 3.141592
x=1.0
y=2.0
angle = 30
radians = angle * (PI/180)
result = Tan(radians) ' Calculate the tangent of 30 degree
radians = Atan(result) ' Calculate the Arctangent of the result
angle = radians * (180/PI)
radians = Atan2(y, x) ' Calculate the Atan2
angle = radians * (180/PI);
8.9 ABS
Return the absolute INTEGER value
Hardware All
Syntax
Abs (number) as long
The argument number can be a LONG value or any numeric expression.
Example
Used variables:
Num long
Num = -3250
Num = Abs(Num) return the value 3250