public double Dvn(double v[], double uv[]) {
        double w1, w2, vm;

        TRACE("Dvn");
        /* Modulus */
        w1 = 0.0;
        for (int i = 0; i < 3; i++) {
            w2 = v[i];
            w1 += w2 * w2;
        }
        w1 = Math.sqrt(w1);
        vm = w1;

        /* Normalize the vector */
        w1 = (w1 > 0.0) ? w1 : 1.0;

        for (int i = 0; i < 3; i++) {
            uv[i] = v[i] / w1;
        }
        ENDTRACE("Dvn");
        return vm;
    }