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

Method Rescale

src/LNLib/Algorithm/KnotVectorUtils.cpp:57–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57std::vector<double> LNLib::KnotVectorUtils::Rescale(const std::vector<double>& knotVector, double min, double max)
58{
59 double originMin = knotVector[0];
60 double originMax = knotVector[knotVector.size() - 1];
61 double k = (max - min) / (originMax - originMin);
62
63 int size = knotVector.size();
64 std::vector<double> result(size);
65 for (int i = 0; i < size; i++)
66 {
67 result[i] = k * (knotVector[i] - originMin) + min;
68 }
69 return result;
70}
71
72std::vector<double> LNLib::KnotVectorUtils::GetInsertedKnotElement(
73 int degree,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected