MCPcopy Create free account
hub / github.com/Teneted/Tenet / distance

Method distance

src/main/java/org/bukkit/util/Vector.java:185–187  ·  view source on GitHub ↗

Get the distance between this vector and another. The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the vector's magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the

(@NotNull Vector o)

Source from the content-addressed store, hash-verified

183 * @return the distance
184 */
185 public double distance(@NotNull Vector o) {
186 return Math.sqrt(NumberConversions.square(x - o.x) + NumberConversions.square(y - o.y) + NumberConversions.square(z - o.z));
187 }
188
189 /**
190 * Get the squared distance between this vector and another.

Callers 1

rayTraceMethod · 0.95

Calls 1

squareMethod · 0.95

Tested by

no test coverage detected