QGIS API Documentation  3.2.0-Bonn (bc43194)
Public Member Functions | Static Public Member Functions | List of all members
QgsVector3D Class Reference

3 Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precision instead of single precision floating point numbers. More...

#include <qgsvector3d.h>

Public Member Functions

 QgsVector3D ()=default
 Constructs a null vector. More...
 
 QgsVector3D (double x, double y, double z)
 Constructs a vector from given coordinates. More...
 
bool isNull () const
 Returns true if all three coordinates are zero. More...
 
double length () const
 Returns the length of the vector. More...
 
void normalize ()
 Normalizes the current vector in place. More...
 
bool operator!= (const QgsVector3D &other) const
 
QgsVector3D operator* (const double factor) const
 Returns a new vector multiplied by scalar. More...
 
QgsVector3D operator+ (const QgsVector3D &other) const
 Returns sum of two vectors. More...
 
QgsVector3D operator- (const QgsVector3D &other) const
 Returns difference of two vectors. More...
 
QgsVector3D operator/ (const double factor) const
 Returns a new vector divided by scalar. More...
 
bool operator== (const QgsVector3D &other) const
 
void set (double x, double y, double z)
 Sets vector coordinates. More...
 
double x () const
 Returns X coordinate. More...
 
double y () const
 Returns Y coordinate. More...
 
double z () const
 Returns Z coordinate. More...
 

Static Public Member Functions

static QgsVector3D crossProduct (const QgsVector3D &v1, const QgsVector3D &v2)
 Returns the cross product of two vectors. More...
 
static double dotProduct (const QgsVector3D &v1, const QgsVector3D &v2)
 Returns the dot product of two vectors. More...
 

Detailed Description

3 Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precision instead of single precision floating point numbers.

Since
QGIS 3.0

Definition at line 29 of file qgsvector3d.h.

Constructor & Destructor Documentation

◆ QgsVector3D() [1/2]

QgsVector3D::QgsVector3D ( )
default

Constructs a null vector.

◆ QgsVector3D() [2/2]

QgsVector3D::QgsVector3D ( double  x,
double  y,
double  z 
)
inline

Constructs a vector from given coordinates.

Definition at line 36 of file qgsvector3d.h.

Member Function Documentation

◆ crossProduct()

static QgsVector3D QgsVector3D::crossProduct ( const QgsVector3D v1,
const QgsVector3D v2 
)
inlinestatic

Returns the cross product of two vectors.

Definition at line 98 of file qgsvector3d.h.

◆ dotProduct()

static double QgsVector3D::dotProduct ( const QgsVector3D v1,
const QgsVector3D v2 
)
inlinestatic

Returns the dot product of two vectors.

Definition at line 92 of file qgsvector3d.h.

◆ isNull()

bool QgsVector3D::isNull ( ) const
inline

Returns true if all three coordinates are zero.

Definition at line 40 of file qgsvector3d.h.

◆ length()

double QgsVector3D::length ( ) const
inline

Returns the length of the vector.

Definition at line 106 of file qgsvector3d.h.

◆ normalize()

void QgsVector3D::normalize ( )
inline

Normalizes the current vector in place.

Definition at line 112 of file qgsvector3d.h.

◆ operator!=()

bool QgsVector3D::operator!= ( const QgsVector3D other) const
inline

Definition at line 61 of file qgsvector3d.h.

◆ operator*()

QgsVector3D QgsVector3D::operator* ( const double  factor) const
inline

Returns a new vector multiplied by scalar.

Definition at line 79 of file qgsvector3d.h.

◆ operator+()

QgsVector3D QgsVector3D::operator+ ( const QgsVector3D other) const
inline

Returns sum of two vectors.

Definition at line 67 of file qgsvector3d.h.

◆ operator-()

QgsVector3D QgsVector3D::operator- ( const QgsVector3D other) const
inline

Returns difference of two vectors.

Definition at line 73 of file qgsvector3d.h.

◆ operator/()

QgsVector3D QgsVector3D::operator/ ( const double  factor) const
inline

Returns a new vector divided by scalar.

Definition at line 86 of file qgsvector3d.h.

◆ operator==()

bool QgsVector3D::operator== ( const QgsVector3D other) const
inline

Definition at line 57 of file qgsvector3d.h.

◆ set()

void QgsVector3D::set ( double  x,
double  y,
double  z 
)
inline

Sets vector coordinates.

Definition at line 50 of file qgsvector3d.h.

◆ x()

double QgsVector3D::x ( ) const
inline

Returns X coordinate.

Definition at line 43 of file qgsvector3d.h.

◆ y()

double QgsVector3D::y ( ) const
inline

Returns Y coordinate.

Definition at line 45 of file qgsvector3d.h.

◆ z()

double QgsVector3D::z ( ) const
inline

Returns Z coordinate.

Definition at line 47 of file qgsvector3d.h.


The documentation for this class was generated from the following file: