QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
20 #include "qgis_core.h"
62 return QgsVector( mX * scalar, mY * scalar );
71 return *
this * ( 1.0 / scalar );
81 return mX * v.mX + mY * v.mY;
90 return QgsVector( mX + other.mX, mY + other.mY );
110 return QgsVector( mX - other.mX, mY - other.mY );
130 return std::sqrt( mX * mX + mY * mY );
140 return mX * mX + mY * mY;
174 const double angle = std::atan2( mY, mX );
194 return mX * v.
y() - mY * v.
x();
228 QString
str =
"Vector (";
237 SIP_PYOBJECT __repr__();
239 QString
str = QStringLiteral(
"<QgsVector: %1>" ).arg( sipCpp->toString() );
240 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
252 #endif // QGSVECTOR_H
Defines a QGIS exception class.
Q_DECLARE_TYPEINFO(QgsVector, Q_MOVABLE_TYPE)
double angle() const SIP_HOLDGIL
Returns the angle of the vector in radians.
QgsMargins operator/(const QgsMargins &margins, double divisor)
Returns a QgsMargins object that is formed by dividing the components of the given margins by the giv...
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
double x() const SIP_HOLDGIL
Returns the vector's x-component.
double y() const SIP_HOLDGIL
Returns the vector's y-component.
QgsMargins operator*(const QgsMargins &margins, double factor)
Returns a QgsMargins object that is formed by multiplying each component of the given margins by fact...
QgsInterval operator-(const QDateTime &dt1, const QDateTime &dt2)
Returns the interval between two datetimes.
A class to represent a vector. Currently no Z axis / 2.5D support is implemented.
QDateTime operator+(const QDateTime &start, const QgsInterval &interval)
Adds an interval to a datetime.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)