MCPcopy Create free account
hub / github.com/Kitware/VTK / TestDistanceToLine

Function TestDistanceToLine

Common/DataModel/Testing/Cxx/UnitTestLine.cxx:495–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495int TestDistanceToLine(vtkMinimalStandardRandomSequence* seq, unsigned nTests)
496{
497 constexpr double epsilon = 256 * std::numeric_limits<double>::epsilon();
498
499 double a1[3], a2[3], p[3], dist;
500
501 for (unsigned i = 0; i < nTests; i++)
502 {
503 GenerateLineAtKnownDistance(seq, a1, a2, p, dist);
504
505 double d = vtkLine::DistanceToLine(p, a1, a2);
506
507 if (std::fabs(dist * dist - d) > epsilon)
508 {
509 return EXIT_FAILURE;
510 }
511 }
512
513 return EXIT_SUCCESS;
514}
515}
516
517int UnitTestLine(int, char*[])

Callers 1

UnitTestLineFunction · 0.85

Calls 1

Tested by

no test coverage detected