/** * Created by IntelliJ IDEA. * User: siddhartha * Date: Feb 1, 2006 * Time: 4:38:06 AM * To change this template use File | Settings | File Templates. */ public class Calculate { public static double average(double[] values) { double total = 0, avg = 0; for(int i = 0; imax) max = values[i]; } return max; } public static double magnitude(double xComp, double yComp) { return Math.sqrt(Math.pow(xComp, 2) + Math.pow(yComp, 2)); } }