MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / GetCentripetalLength

Method GetCentripetalLength

src/LNLib/Algorithm/Interpolation.cpp:95–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95double LNLib::Interpolation::GetCentripetalLength(const std::vector<XYZ>& throughPoints)
96{
97 if (throughPoints.size() < 2)
98 return 0.0;
99
100 double length = 0.0;
101 for (size_t i = 1; i < throughPoints.size(); ++i) {
102 double dist = throughPoints[i].Distance(throughPoints[i - 1]);
103 length += std::sqrt(dist);
104 }
105 return length;
106}
107
108std::vector<double> LNLib::Interpolation::GetCentripetalParameterization(const std::vector<XYZ>& throughPoints)
109{

Callers

nothing calls this directly

Calls 1

DistanceMethod · 0.45

Tested by

no test coverage detected