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

Function solveCubic

MyGUIEngine/src/msdfgen/core/equation-solver.cpp:63–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63int solveCubic(double x[3], double a, double b, double c, double d) {
64 if (a != 0) {
65 double bn = b/a;
66 if (fabs(bn) < 1e6) // Above this ratio, the numerical error gets larger than if we treated a as zero
67 return solveCubicNormed(x, bn, c/a, d/a);
68 }
69 return solveQuadratic(x, b, c, d);
70}
71
72}

Callers 2

signedDistanceMethod · 0.85
scanlineIntersectionsMethod · 0.85

Calls 2

solveCubicNormedFunction · 0.85
solveQuadraticFunction · 0.85

Tested by

no test coverage detected