diff --git a/src/java/com/threerings/media/util/MathUtil.java b/src/java/com/threerings/media/util/MathUtil.java index 6baca5abe..55f9f8a31 100644 --- a/src/java/com/threerings/media/util/MathUtil.java +++ b/src/java/com/threerings/media/util/MathUtil.java @@ -1,5 +1,5 @@ // -// $Id: MathUtil.java,v 1.12 2004/11/04 04:52:31 mdb Exp $ +// $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -40,6 +40,14 @@ public class MathUtil return Math.min(high, Math.max(low, value)); } + /** + * Return the squared distance between the given points. + */ + public static int distanceSq (int x0, int y0, int x1, int y1) + { + return ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0)); + } + /** * Return the distance between the given points. */