MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / distanceToStraightLine

Method distanceToStraightLine

qcustomplot/qcustomplot.cpp:213–216  ·  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

211 \see distanceSquaredToLine
212*/
213double 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

Callers 1

selectTestMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected