On this page
vector2d QML Basic Type
A vector2d type has x and y attributes.
A vector2d type has x and y attributes, otherwise it is similar to the vector3d type. Please see the documentation about the vector3d type for more information.
To create a vector2d value, specify it as a "x,y" string, or define the components individually, or compose it with the Qt.vector2d() function.
The vector2d type has the following idempotent functions which can be invoked in QML:
| Function Signature | Description | Example | 
|---|---|---|
| real dotProduct(vector2d other) | Returns the scalar real result of the dot product of thisvector2d with theothervector2d |  | 
| vector2d times(vector2d other) | Returns the vector2d result of multiplying thisvector2d with theothervector2d |  | 
| vector2d times(real factor) | Returns the vector2d result of multiplying thisvector2d with the scalarfactor |  | 
| vector2d plus(vector2d other) | Returns the vector2d result of the addition of thisvector2d with theothervector2d |  | 
| vector2d minus(vector2d other) | Returns the vector2d result of the subtraction of othervector2d fromthisvector2d |  | 
| vector2d normalized() | Returns the normalized form of thisvector |  | 
| real length() | Returns the scalar real value of the length of thisvector2d |  | 
| vector3d toVector3d() | Returns the vector3d result of converting thisvector2d to a vector3d |  | 
| vector4d toVector4d() | Returns the vector4d result of converting thisvector2d to a vector4d |  | 
| bool fuzzyEquals(vector2d other, real epsilon) | Returns true if thisvector2d is approximately equal to theothervector2d. The approximation will be true if each attribute ofthisis withinepsilonofother. Note thatepsilonis an optional argument, the defaultepsilonis 0.00001. |  | 
This basic type is provided by the QtQuick import.
See also QML Basic Types.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
 https://doc.qt.io/archives/qt-5.6/qml-vector2d.html