Class: QgsVector3D¶
-
class
qgis.core.
QgsVector3D
¶ Bases:
sip.wrapper
Constructs a null vector
QgsVector3D(x: float, y: float, z: float) Constructs a vector from given coordinates
QgsVector3D(v: QVector3D) Constructs a vector from single-precision QVector3D
QgsVector3D(
QgsVector3D
)Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precision instead of single precision floating point numbers.
Methods
Returns the cross product of two vectors
Returns the dot product of two vectors
Returns true if all three coordinates are zero
Returns the length of the vector
Normalizes the current vector in place.
Sets vector coordinates
Returns X coordinate
Returns Y coordinate
Returns Z coordinate
-
crossProduct
(v1: QgsVector3D, v2: QgsVector3D) → QgsVector3D¶ Returns the cross product of two vectors
- Parameters
v1 (QgsVector3D) –
v2 (QgsVector3D) –
- Return type
-
dotProduct
(v1: QgsVector3D, v2: QgsVector3D) → float¶ Returns the dot product of two vectors
- Parameters
v1 (QgsVector3D) –
v2 (QgsVector3D) –
- Return type
float
-
isNull
(self) → bool¶ Returns true if all three coordinates are zero
- Return type
bool
-
length
(self) → float¶ Returns the length of the vector
- Return type
float
-
normalize
(self)¶ Normalizes the current vector in place.
-
set
(self, x: float, y: float, z: float)¶ Sets vector coordinates
- Parameters
x (float) –
y (float) –
z (float) –
-
x
(self) → float¶ Returns X coordinate
- Return type
float
-
y
(self) → float¶ Returns Y coordinate
- Return type
float
-
z
(self) → float¶ Returns Z coordinate
- Return type
float
-