MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / distance

Method distance

src/main/java/com/volmit/adapt/util/Point4d.java:155–163  ·  view source on GitHub ↗

Returns the distance between this point and point p1. @param p1 the first point @return the distance between these this point and point p1.

(Point4d p1)

Source from the content-addressed store, hash-verified

153 * @return the distance between these this point and point p1.
154 */
155 public final double distance(Point4d p1) {
156 double dx, dy, dz, dw;
157
158 dx = this.x - p1.x;
159 dy = this.y - p1.y;
160 dz = this.z - p1.z;
161 dw = this.w - p1.w;
162 return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);
163 }
164
165
166 /**

Callers

nothing calls this directly

Calls 1

sqrtMethod · 0.80

Tested by

no test coverage detected