MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / unit

Method unit

Geometry/Geometry 3D.cpp:68–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 double abs() { return sqrt(x * x + y * y + z * z); }
67 double sq() { return x * x + y * y + z * z; }
68 p3 unit() { return *this / abs(); }
69}zero(0, 0, 0);
70double operator | (p3 v, p3 w) { //dot product
71 return v.x * w.x + v.y * w.y + v.z * w.z;

Callers 1

Calls 1

absFunction · 0.85

Tested by

no test coverage detected