KiCad PCB EDA Suite
|
#include <line.h>
Public Types | |
using | ecoord = VECTOR2I::extended_type |
Public Member Functions | |
LINE (const SEG &aSeg) | |
LINE (const VECTOR2I &aStart, const VECTOR2I &aEnd) | |
bool | operator== (const LINE &aOther) const |
const SEG & | GetContainedSeg () const |
Gets the (one of the infinite number of) segments that the line passes through. | |
OPT_VECTOR2I | Intersect (const SEG &aOther) const |
OPT_VECTOR2I | Intersect (const LINE &aOther) const |
int | Distance (const VECTOR2I &aPoint) const |
Gets the distance from the line to the given point. | |
VECTOR2I | NearestPoint (const VECTOR2I &aPoint) const |
Gets the nearest point on the line to the given point. | |
Private Attributes | |
SEG | m_seg |
Internally, we can represent a just a segment that the line passes through. | |
using LINE::ecoord = VECTOR2I::extended_type |
int LINE::Distance | ( | const VECTOR2I & | aPoint | ) | const |
Gets the distance from the line to the given point.
Definition at line 46 of file line.cpp.
References SEG::LineDistance(), and m_seg.
|
inline |
OPT_VECTOR2I LINE::Intersect | ( | const LINE & | aOther | ) | const |
Definition at line 40 of file line.cpp.
References SEG::Intersect(), and m_seg.
OPT_VECTOR2I LINE::Intersect | ( | const SEG & | aOther | ) | const |
Definition at line 22 of file line.cpp.
References SEG::Contains(), SEG::Intersect(), and m_seg.
Referenced by KIGEOM::ClipLineToBox().
Gets the nearest point on the line to the given point.
Definition at line 52 of file line.cpp.
References SEG::A, SEG::B, VECTOR2< T >::Dot(), m_seg, rescale(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inline |
|
private |
Internally, we can represent a just a segment that the line passes through.
Definition at line 66 of file line.h.
Referenced by Distance(), GetContainedSeg(), Intersect(), NearestPoint(), and operator==().