37 return ( ( aA.
x >= 0 ) == ( aB.
x >= 0 ) ) && ( ( aA.
y >= 0 ) == ( aB.
y >= 0 ) );
53 return m_seg.LineDistance( aPoint ) <= 1;
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.
HALF_LINE(const SEG &aSeg)
Construct a ray from a segment - the ray will start at the segment's A point and extend infinitely in...
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.
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
Define a general 2D-vector/point.
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).
VECTOR2< int32_t > VECTOR2I
VECTOR2< int64_t > VECTOR2L