MCPcopy Create free account
hub / github.com/andrewwillmott/splines-lib / ArcError

Function ArcError

Splines.cpp:1400–1414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1398namespace
1399{
1400 inline float ArcError(const Spline2& s, float* tSplit)
1401 {
1402 Vec2f ex = ArcError2(s.xb);
1403 Vec2f ey = ArcError2(s.yb);
1404
1405 float e0 = ex.x + ey.x;
1406 float e1 = ex.y + ey.y;
1407 float es2 = e0 + e1;
1408
1409 float f = (es2 < 1e-6f) ? 0.5f : sqrtf(e0 / es2);
1410
1411 *tSplit = (1.0f / 3.0f) * (1.0f + f);
1412
1413 return sqrtf(es2);
1414 }
1415
1416 void SubdivideForT(const Spline2& s, vector<Spline2>* splines, float tolerance)
1417 {

Callers 1

SubdivideForTFunction · 0.85

Calls 1

ArcError2Function · 0.85

Tested by

no test coverage detected