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

Method isInSphere

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

Returns whether this vector is within a sphere. @param origin Sphere origin. @param radius Sphere radius @return whether this vector is in the sphere

(@NotNull Vector origin, double radius)

Source from the content-addressed store, hash-verified

400 * @return whether this vector is in the sphere
401 */
402 public boolean isInSphere(@NotNull Vector origin, double radius) {
403 return (NumberConversions.square(origin.x - x) + NumberConversions.square(origin.y - y) + NumberConversions.square(origin.z - z)) <= NumberConversions.square(radius);
404 }
405
406 /**
407 * Returns if a vector is normalized

Callers

nothing calls this directly

Calls 1

squareMethod · 0.95

Tested by

no test coverage detected