MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / getTangent

Method getTangent

common/map_sdk/map_import/src/OpenDriveStruct.cpp:575–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575void ODGeometry::getTangent(std::vector<std::pair<double, double>>& tangents) const {
576 if (length() < 1e-6) {
577 return;
578 }
579 std::vector<double> intervals;
580 getInterval(intervals);
581 tangents.resize(intervals.size());
582 for (size_t i = 0; i < intervals.size(); i++) {
583 double h = getHeading(intervals[i] + offset());
584 tangents[i] = std::make_pair(std::cos(h), std::sin(h));
585 }
586}
587
588void ODGeometry::getNormal(std::vector<std::pair<double, double>>& normals) const {
589 if (length() < 1e-6) {

Callers 2

roadTangentMethod · 0.80

Calls 3

lengthFunction · 0.50
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected