QVector2D¶
- PyQt5.QtGui.QVector2D
Description¶
The QVector2D class represents a vector or vertex in 2D space.
The QVector2D class can also be used to represent vertices in 2D space. We therefore do not need to provide a separate vertex class.
See also
Methods¶
- __init__()
TODO
- __init__(QPoint)
TODO
- __init__(QVector3D)
Constructs a vector with x and y coordinates from a 3D vector. The z coordinate of vector is dropped.
See also
- __init__(QVector4D)
Constructs a vector with x and y coordinates from a 3D vector. The z and w coordinates of vector are dropped.
See also
- __init__(QVector2D)
TODO
- __init__(float, float)
TODO
- distanceToPoint(QVector2D) float
TODO
- __eq__(QVector2D) bool
TODO
- __getitem__(int) float
TODO
- __imul__(float) QVector2D
TODO
- isNull() bool
TODO
- __itruediv__(float) QVector2D
TODO
- length() float
Returns the length of the vector from the origin.
See also
- lengthSquared() float
Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.
See also
- __mul__(float) QVector2D
TODO
- __ne__(QVector2D) bool
TODO
- __neg__() QVector2D
TODO
- normalize()
Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.
See also
- normalized() QVector2D
Returns the normalized unit vector form of this vector.
If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.
See also
- __repr__() str
TODO
- __rmul__(float) QVector2D
TODO
- setX(float)
TODO
- setY(float)
TODO
- toPoint() QPoint
TODO
- toPointF() QPointF
TODO
- toVector3D() QVector3D
Returns the 3D form of this 2D vector, with the z coordinate set to zero.
See also
- toVector4D() QVector4D
Returns the 4D form of this 2D vector, with the z and w coordinates set to zero.
See also
- __truediv__(float) QVector2D
TODO
- x() float
See also
- y() float
See also