Class MathUtil

java.lang.Object
de.articdive.jnoise.core.util.MathUtil

public final class MathUtil extends Object
Utility class for mathematical functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    dot2D(double[] a, double[] b)
    Calculates the dot product of the specified 2D vectors.
    static double
    dot3D(double[] a, double[] b)
    Calculates the dot product of the specified 3D vectors.
    static double
    dot4D(double[] a, double[] b)
    Calculates the dot product of the specified 4D vectors.
    static double
    exp2(double x)
    Calculates 2^x of the specified value.
    static double
    log2(double x)
    Calculates log_2 of the specified value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • exp2

      public static double exp2(double x)
      Calculates 2^x of the specified value.
      Parameters:
      x - specified value
      Returns:
      2^x.
    • log2

      public static double log2(double x)
      Calculates log_2 of the specified value.
      Parameters:
      x - specified value
      Returns:
      log_2(x).
    • dot2D

      public static double dot2D(double[] a, double[] b)
      Calculates the dot product of the specified 2D vectors.
      Parameters:
      a - a double array representing a 2D vector.
      b - a double array representing a 2D vector.
      Returns:
      the dot product of the two 2D vectors.
    • dot3D

      public static double dot3D(double[] a, double[] b)
      Calculates the dot product of the specified 3D vectors.
      Parameters:
      a - a double array representing a 3D vector.
      b - a double array representing a 3D vector.
      Returns:
      the dot product of the two 3D vectors.
    • dot4D

      public static double dot4D(double[] a, double[] b)
      Calculates the dot product of the specified 4D vectors.
      Parameters:
      a - a double array representing a 4D vector.
      b - a double array representing a 4D vector.
      Returns:
      the dot product of the two 4D vectors.