! 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 */
| 223 | \see distanceSquaredToLine |
| 224 | */ |
| 225 | double QCPVector2D::distanceToStraightLine(const QCPVector2D &base, const QCPVector2D &direction) const |
| 226 | { |
| 227 | return qAbs((*this-base).dot(direction.perpendicular()))/direction.length(); |
| 228 | } |
| 229 | |
| 230 | /*! |
| 231 | Scales this vector by the given \a factor, i.e. the x and y components are multiplied by \a |