ZenoTest
ZenoTest — Windows desktop UI test automation for Qt, WPF, WinForms & native apps. Record, script, and run automated GUI tests with CI/CD integration.

vec2d

Description
Represents a 2-dimensional vector object consisting of two floating-point values (x, y).
vec2d provides arithmetic operators, value assignment, printing and resetting, as well as several vector-specific script methods like normalization, length calculation and null-vector checking.

An vec2d is typically created and manipulated inside scripts when 2D positions, offsets or directions are required.

Methods
void normalize()
Normalizes the vector so that its length becomes 1 (unit vector).
If the vector is a null vector, no change is applied.

float length()
Returns the floating-point vector length calculated as sqrt(x*x + y*x).

bool isNull()
Checks whether the vector is a null vector (x = 0 and y = 0).
Returns true if the vector is zero-length.

void set(float x, float y)
Assigns new floating-point values to the vector.
Example: v.set(10.0, 5.0);

Operators
vec2d supports the operators +, - and * with another vector, returning a new vec2d.

Example
void main()
{
    vec2d v(3.0, 4.0);
    float len = v.length();
    Print("Length: " + len);
    
    v.normalize();
    Print("Normalized vector length: " + v.length());
    
    bool isZero = v.isNull();
    Print("Is Null Vector: " + isZero);
    
    v.set(10.0, 5.0);
    Print("Vector set to ");
    Print(v);
}
#define #include CloseAUT Console mode do...while DoubleClick Execute Fail File for GetAUTFileVersion GetAUTProductVersion GetAUTQtVersion GetAUTSuspectedCompiler GetAUTSuspectedFramework GetCurrentWorkingDir GetName GetProcessID GetProcessIDHandle GetQtProperty GetText GetValue Handle HasFocus IsAUT64Bit IsChecked IsEnabled IsVisible LeftMouseClick LeftMouseDown LeftMouseUp MiddleMouseDown MiddleMouseUp MouseWheel Pass Predefined Constants Print rand RightMouseClick RightMouseDown RightMouseUp Script Language SendKeys SendMessage SetFocus SetNotFoundBehavior SetQtProperty ShellProcess Sleep StartAUT string TerminateProcess TimerStart TimerStop TimerVerifyLess vec2d VerifyContains VerifyEndsWith VerifyEqual VerifyExists VerifyGreater VerifyLess VerifyNotEqual VerifyNotExists VerifyScreenCompareEdgeBased VerifyScreenComparePixelExact VerifyStartsWith while