distanceSquared method

double distanceSquared(
  1. Vec3 p
)

Get squared distance from this point to another point

Implementation

double distanceSquared(Vec3 p) {
  final px = p.x;
  final py = p.y;
  final pz = p.z;
  return (px - x) * (px - x) + (py - y) * (py - y) + (pz - z) * (pz - z);
}