MCPcopy Create free account
hub / github.com/comaps/comaps / CalculateNormal

Method CalculateNormal

libs/drape_frontend/apply_feature_functors.cpp:758–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758m2::PointD ApplyAreaFeature::CalculateNormal(m2::PointD const & p1, m2::PointD const & p2, m2::PointD const & p3) const
759{
760 m2::PointD const tangent = (p2 - p1).Normalize();
761 m2::PointD normal = m2::PointD(-tangent.y, tangent.x);
762 m2::PointD const v = ((p1 + p2) * 0.5 - p3).Normalize();
763 if (m2::DotProduct(normal, v) < 0.0)
764 normal = -normal;
765
766 return normal;
767}
768
769void ApplyAreaFeature::BuildEdges(int vertexIndex1, int vertexIndex2, int vertexIndex3, bool twoSide)
770{

Callers

nothing calls this directly

Calls 2

DotProductFunction · 0.50
NormalizeMethod · 0.45

Tested by

no test coverage detected