MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / distanceToStraightLine

Method distanceToStraightLine

3rdparty/qcustomplot/qcustomplot.cpp:225–228  ·  view source on GitHub ↗

! 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 */

Source from the content-addressed store, hash-verified

223 \see distanceSquaredToLine
224*/
225double 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

Callers 1

selectTestMethod · 0.80

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected