using System; using aima.basic; namespace aima.util { /// /// Ported to .NET by Kris Noesgaard /// from the Java implementation by Ravi Mohan /// public class Calculator { public static int calculateSquareOfDistanceBetweenLocations( XYLocation loc1, XYLocation loc2) { int xdifference = loc1.getXCoOrdinate() - loc2.getXCoOrdinate(); int ydifference = loc1.getYCoOrdinate() - loc2.getYCoOrdinate(); return (xdifference * xdifference) + (ydifference * ydifference); } } }