! Returns the shortest distance of this vector (interpreted as a point) to the infinite straight line given by a \a base point and a \a direction vector. \see distanceSquaredToLine */
| 211 | \see distanceSquaredToLine |
| 212 | */ |
| 213 | double QCPVector2D::distanceToStraightLine(const QCPVector2D &base, const QCPVector2D &direction) const |
| 214 | { |
| 215 | return qAbs((*this-base).dot(direction.perpendicular()))/direction.length(); |
| 216 | } |
| 217 | |
| 218 | /*! |
| 219 | Scales this vector by the given \a factor, i.e. the x and y components are multiplied by \a |