MCPcopy Index your code
hub / github.com/PaperMC/Paper / distance

Method distance

paper-api/src/main/java/org/bukkit/Location.java:559–561  ·  view source on GitHub ↗

Get the distance between this location 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 location's magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if

(@NotNull Location o)

Source from the content-addressed store, hash-verified

557 * @see Vector
558 */
559 public double distance(@NotNull Location o) {
560 return Math.sqrt(distanceSquared(o));
561 }
562
563 /**
564 * Get the squared distance between this location and another.

Callers

nothing calls this directly

Calls 1

distanceSquaredMethod · 0.95

Tested by

no test coverage detected