Java Array Length Get length(double[] x)

Here you can find the source of length(double[] x)

Description

length

License

Creative Commons License

Declaration

public static double length(double[] x) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    public static double length(double[] x) {

        double len = 0;

        for (int index = 0; index < x.length; index++)
            len += x[index] * x[index];//ww w .j  a  v  a 2s.  co  m

        return Math.sqrt(len);

    }
}

Related

  1. length(byte[] array)
  2. length(byte[] array)
  3. length(double[] a)
  4. length(double[] point)
  5. length(double[] v)
  6. length(final double[] a)
  7. length(final Object[] array)
  8. length(final T[]... arrays)
  9. length(float[] color)