squaredDistanceTo method

double squaredDistanceTo(
  1. Vector3 v
)

Computes the squared euclidean distance between this 3D vector and the given one. Calling this method is faster than calling {@link Vector3#distanceTo}, since it avoids computing a square root.

Implementation

double squaredDistanceTo(Vector3 v ) {
	final dx = x - v.x, dy = y - v.y, dz = z - v.z;
	return ( dx * dx ) + ( dy * dy ) + ( dz * dz );
}