MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / distanceSqToCenter

Method distanceSqToCenter

src/main/java/net/minecraft/util/Vec3i.java:108–114  ·  view source on GitHub ↗

Compute square of distance from point x, y, z to center of this Block

(double xIn, double yIn, double zIn)

Source from the content-addressed store, hash-verified

106 * Compute square of distance from point x, y, z to center of this Block
107 */
108 public double distanceSqToCenter(double xIn, double yIn, double zIn)
109 {
110 double d0 = (double)this.getX() + 0.5D - xIn;
111 double d1 = (double)this.getY() + 0.5D - yIn;
112 double d2 = (double)this.getZ() + 0.5D - zIn;
113 return d0 * d0 + d1 * d1 + d2 * d2;
114 }
115
116 /**
117 * Calculate squared distance to the given Vector

Callers 1

getDistanceSqToCenterMethod · 0.80

Calls 3

getXMethod · 0.95
getYMethod · 0.95
getZMethod · 0.95

Tested by

no test coverage detected