MCPcopy Create free account
hub / github.com/MyGUI/mygui / symmetricalTrichotomy

Function symmetricalTrichotomy

MyGUIEngine/src/msdfgen/core/edge-coloring.cpp:19–21  ·  view source on GitHub ↗

* For each position < n, this function will return -1, 0, or 1, * depending on whether the position is closer to the beginning, middle, or end, respectively. * It is guaranteed that the output will be balanced in that the total for positions 0 through n-1 will be zero. */

Source from the content-addressed store, hash-verified

17 * It is guaranteed that the output will be balanced in that the total for positions 0 through n-1 will be zero.
18 */
19static int symmetricalTrichotomy(int position, int n) {
20 return int(3+2.875*position/(n-1)-1.4375+.5)-3;
21}
22
23static bool isCorner(const Vector2 &aDir, const Vector2 &bDir, double crossThreshold) {
24 return dotProduct(aDir, bDir) <= 0 || fabs(crossProduct(aDir, bDir)) > crossThreshold;

Callers 3

edgeColoringSimpleFunction · 0.85
edgeColoringInkTrapFunction · 0.85
edgeColoringByDistanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected