QGIS/python/core/auto_generated/qgsvector.sip.in

132 lines
3.2 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsvector.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2017-02-24 12:39:34 +01:00
class QgsVector
{
%Docstring
2017-12-15 10:36:55 -04:00
A class to represent a vector.
Currently no Z axis / 2.5D support is implemented.
2017-02-24 12:39:34 +01:00
%End
%TypeHeaderCode
#include "qgsvector.h"
%End
2017-02-24 12:39:34 +01:00
public:
2017-02-24 12:39:34 +01:00
QgsVector();
%Docstring
2017-12-15 10:36:55 -04:00
Default constructor for QgsVector. Creates a vector with length of 0.0.
%End
2017-02-24 12:39:34 +01:00
QgsVector( double x, double y );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsVector taking x and y component values.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param x: x-component
:param y: y-component
%End
2017-02-24 12:39:34 +01:00
QgsVector operator-() const;
QgsVector operator*( double scalar ) const;
QgsVector operator/( double scalar ) const;
double operator*( QgsVector v ) const;
QgsVector operator+( QgsVector other ) const;
QgsVector &operator+=( QgsVector other );
2017-02-24 12:39:34 +01:00
QgsVector operator-( QgsVector other ) const;
2017-02-24 12:39:34 +01:00
QgsVector &operator-=( QgsVector other );
2017-02-24 12:39:34 +01:00
double length() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the length of the vector.
2018-04-12 12:00:44 +10:00
.. seealso:: :py:func:`lengthSquared`
%End
double lengthSquared() const;
%Docstring
Returns the length of the vector.
.. seealso:: :py:func:`length`
2018-05-28 11:31:08 -04:00
.. versionadded:: 3.2
%End
2017-02-24 12:39:34 +01:00
double x() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the vector's x-component.
.. seealso:: y
%End
2017-02-24 12:39:34 +01:00
double y() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the vector's y-component.
.. seealso:: x
%End
2017-02-24 12:39:34 +01:00
QgsVector perpVector() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the perpendicular vector to this vector (rotated 90 degrees counter-clockwise)
%End
2017-02-24 12:39:34 +01:00
double angle() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the angle of the vector in radians.
%End
2017-02-24 12:39:34 +01:00
double angle( QgsVector v ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the angle between this vector and another vector in radians.
2018-04-12 12:00:44 +10:00
%End
double crossProduct( QgsVector v ) const;
%Docstring
Returns the 2D cross product of this vector and another vector ``v``. (This is sometimes
referred to as a "perpendicular dot product", and equals x1 * y1 - y1 * x2).
.. versionadded:: 3.2
%End
2017-02-24 12:39:34 +01:00
QgsVector rotateBy( double rot ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Rotates the vector by a specified angle.
2017-12-15 21:36:08 -04:00
:param rot: angle in radians
%End
2017-02-24 12:39:34 +01:00
QgsVector normalized() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the vector's normalized (or "unit") vector (ie same angle but length of 1.0).
Will throw a QgsException if called on a vector with length of 0.
%End
2017-02-24 12:39:34 +01:00
bool operator==( QgsVector other ) const;
bool operator!=( QgsVector other ) const;
2017-02-24 12:39:34 +01:00
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsvector.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/