37 return ( ( aA.
x >= 0 ) == ( aB.
x >= 0 ) ) && ( ( aA.
y >= 0 ) == ( aB.
y >= 0 ) );
78 if( !aSeg.
Contains( *intersection ) )
102 *intersection - aOther.
m_seg.
A ) )
OPT_VECTOR2I Intersect(const SEG &aSeg) const
const SEG & GetContainedSeg() const
Gets the (one of the infinite number of) segments that the ray passes through.
SEG m_seg
Internally, we can represent a just a segment that the ray passes through.
bool Contains(const VECTOR2I &aPoint) const
VECTOR2I NearestPoint(const VECTOR2I &aPoint) const
Get the nearest point on the ray to the given point.
int LineDistance(const VECTOR2I &aP, bool aDetermineSide=false) const
Return the closest Euclidean distance between point aP and the line defined by the ends of segment (t...
VECTOR2I::extended_type ecoord
OPT_VECTOR2I Intersect(const SEG &aSeg, bool aIgnoreEndpoints=false, bool aLines=false) const
Compute intersection point of segment (this) with segment aSeg.
bool Contains(const SEG &aSeg) const
constexpr extended_type Dot(const VECTOR2< T > &aVector) const
Compute dot product of self with aVector.
bool VectorsInSameQuadrant(const VECTOR2I &aA, const VECTOR2I &aB)
Check if two vectors point into the same quadrant.
std::optional< VECTOR2I > OPT_VECTOR2I
Utility functions for working with shapes.
T rescale(T aNumerator, T aValue, T aDenominator)
Scale a number (value) by rational (numerator/denominator).