Skip to content

Commit 9c102e1

Browse files
authored
MathUtil squaredist (#910)
1 parent c2c3ad9 commit 9c102e1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/commons/MathUtil.h

+7
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,13 @@ class MathUtil {
256256
return sum;
257257
}
258258

259+
static float squareDist(const float xx, const float xy, const float xz,
260+
const float yx, const float yy, const float yz){
261+
float d1 = xx - yx;
262+
float d2 = xy - yy;
263+
float d3 = xz - yz;
264+
return (d1 * d1 + d2 * d2 + d3 * d3);
265+
}
259266

260267
};
261268

0 commit comments

Comments
 (0)