|
|
| QCPVector2D () |
| | Creates a QCPVector2D object and initializes the x and y coordinates to 0.
|
| |
|
| QCPVector2D (double x, double y) |
| | Creates a QCPVector2D object and initializes the x and y coordinates with the specified values.
|
| |
|
| QCPVector2D (const QPoint &point) |
| | Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of the specified point.
|
| |
|
| QCPVector2D (const QPointF &point) |
| | Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of the specified point.
|
| |
|
double | x () const |
| |
|
double | y () const |
| |
|
double & | rx () |
| |
|
double & | ry () |
| |
| void | setX (double x) |
| | Sets the x coordinate of this vector to x.
|
| |
| void | setY (double y) |
| | Sets the y coordinate of this vector to y.
|
| |
| double | length () const |
| | Returns the length of this vector.
|
| |
| double | lengthSquared () const |
| | Returns the squared length of this vector.
|
| |
| QPoint | toPoint () const |
| | Returns a QPoint which has the x and y coordinates of this vector, truncating any floating point information.
|
| |
| QPointF | toPointF () const |
| | Returns a QPointF which has the x and y coordinates of this vector.
|
| |
| bool | isNull () const |
| | Returns whether this vector is null.
|
| |
| void | normalize () |
| | Normalizes this vector.
|
| |
| QCPVector2D | normalized () const |
| | Returns a normalized version of this vector.
|
| |
|
QCPVector2D | perpendicular () const |
| | Returns a vector perpendicular to this vector, with the same length.
|
| |
|
double | dot (const QCPVector2D &vec) const |
| | Returns the dot/scalar product of this vector with the specified vector vec.
|
| |
| double | distanceSquaredToLine (const QCPVector2D &start, const QCPVector2D &end) const |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the squared shortest distance of this vector (interpreted as a point) to the finite line segment given by start and end.
|
| |
| double | distanceSquaredToLine (const QLineF &line) const |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the squared shortest distance of this vector (interpreted as a point) to the finite line segment given by line.
|
| |
| double | distanceToStraightLine (const QCPVector2D &base, const QCPVector2D &direction) const |
| | Returns the shortest distance of this vector (interpreted as a point) to the infinite straight line given by a base point and a direction vector.
|
| |
| QCPVector2D & | operator*= (double factor) |
| | Scales this vector by the given factor, i.e.
|
| |
| QCPVector2D & | operator/= (double divisor) |
| | Scales this vector by the given divisor, i.e.
|
| |
|
QCPVector2D & | operator+= (const QCPVector2D &vector) |
| | Adds the given vector to this vector component-wise.
|
| |
|
QCPVector2D & | operator-= (const QCPVector2D &vector) |
| | subtracts the given vector from this vector component-wise.
|
| |
Represents two doubles as a mathematical 2D vector.
This class acts as a replacement for QVector2D with the advantage of double precision instead of single, and some convenience methods tailored for the QCustomPlot library.