package lab5; public class VectorMath { /** * Name: magnitude * PreCondition: arrays are not null * PostCondition: Returns the calcuated magnitude * @params vec - contains a vector to find magnitude */ public static double magnitude(double vec[]) { // the magnitude of a vector v is calculatd as // sqrt(v[0] * v[0] + v[1] * v[1] + ...) } }