MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / side

Method side

utilities/olcUTIL_Geometry2D.h:602–612  ·  view source on GitHub ↗

Return which side of the line does a point lie

Source from the content-addressed store, hash-verified

600
601 // Return which side of the line does a point lie
602 inline constexpr int32_t side(const olc::v_2d<T>& point) const
603 {
604 double d = vector().cross(point - start);
605 if (d < 0)
606 return -1;
607 else
608 if (d > 0)
609 return 1;
610 else
611 return 0;
612 }
613
614 // Returns line equation "mx + a" coefficients where:
615 // x: m

Callers 5

intersectsFunction · 0.45
overlapsFunction · 0.45
containsFunction · 0.45
projectFunction · 0.45
collisionFunction · 0.45

Calls 1

crossMethod · 0.45

Tested by

no test coverage detected