Size: 333 bytes.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
// cs/renderer/geo/dist.cc
#include "cs/renderer/geo/point3.h"
#include "cs/renderer/geo/vector3.h"

namespace cs::renderer::geo {

float dist(p3 a, p3 b) {
  p3 diff = b - a;
  float x2 = diff.x * diff.x;
  float y2 = diff.y * diff.y;
  float z2 = diff.z * diff.z;
  return sqrtf(x2 + y2 + z2);
}

}  // namespace cs::renderer::geo
v0 (commit) © 2025 @p13i.io | Load balancer proxied to: cs-code-viewer-2:8080 in 4ms.