MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / calculateOutgoingTangent

Method calculateOutgoingTangent

src/core/virtual_path.cpp:590–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588}
589
590MapCoordF VirtualPath::calculateOutgoingTangent(
591 size_type i,
592 bool& ok) const
593{
594 ok = true;
595 MapCoordF tangent;
596
597 for (auto k = i+1; k <= last_index; ++k)
598 {
599 tangent = coords[k] - coords[i];
600 if (tangent.lengthSquared() > PathCoord::tangentEpsilonSquared())
601 return tangent;
602 }
603
604 if (isClosed())
605 {
606 // Continue from start
607 for (auto k = first_index; k < i; ++k)
608 {
609 tangent = coords[k] - coords[i];
610 if (tangent.lengthSquared() > PathCoord::tangentEpsilonSquared())
611 return tangent;
612 }
613 }
614
615 ok = false;
616 return tangent;
617}
618
619void VirtualPath::copy(
620 const SplitPathCoord& first,

Callers 3

extentIncludeJoinMethod · 0.80
shiftCoordinatesMethod · 0.80

Calls 1

lengthSquaredMethod · 0.80

Tested by

no test coverage detected