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

Method distTo

code/geometry/primitives3d.cpp:26–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 double length() const {
25 return sqrt(*this % *this); }
26 double distTo(P(p)) const {
27 return (*this - p).length(); }
28 double distTo(P(A), P(B)) const {
29 // A and B must be two different points
30 return ((*this - A) * (*this - B)).length() / A.distTo(B);}

Callers 1

testFunction · 0.80

Calls 1

lengthMethod · 0.80

Tested by 1

testFunction · 0.64