MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / signedDistTo

Method signedDistTo

code/geometry/primitives3d.cpp:31–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 // A and B must be two different points
30 return ((*this - A) * (*this - B)).length() / A.distTo(B);}
31 double signedDistTo(PL(A,B,C)) const {
32 // A, B and C must not be collinear
33 point3d N = (B-A)*(C-A); double D = A%N;
34 return ((*this)%N - D)/N.length(); }
35 point3d normalize(double k = 1) const {
36 // length() must not return 0
37 return (*this) * (k / length()); }

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected