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

Method Normalize

libs/geometry/point2d.hpp:106–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 double Length() const { return std::sqrt(SquaredLength()); }
105
106 Point<T> Normalize() const
107 {
108 if (IsAlmostZero())
109 return Zero();
110
111 double const length = this->Length();
112 return Point<T>(x / length, y / length);
113 }
114
115 std::pair<Point<T>, Point<T>> Normals(T prolongationFactor = 1) const
116 {

Callers 2

GetArrowPointsFunction · 0.45
PointAtSegmentFunction · 0.45

Calls 2

LengthMethod · 0.95
ZeroFunction · 0.85

Tested by

no test coverage detected