Class VectorUtils


  • public final class VectorUtils
    extends Object
    • Method Detail

      • magnitude

        public static float magnitude​(float[] vector)
        Calculates the magnitude of the vector.
        Parameters:
        vector - The vector to calculate magnitude for.
        Returns:
        The magnitude.
      • normalize

        public static float[] normalize​(float[] vector)
        Turns vector to unit vector.
        Parameters:
        vector - The vector to normalize.
        Returns:
        the input vector as a unit vector