Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.encog.mathutil
Class EncogMath

    java.lang.Object
      org.encog.mathutil.EncogMath

    public final class EncogMath

extends Object

Several useful math functions for Encog.

Method Summary
`static double` | `deg2rad(double deg)` Convert degrees to radians.
`static boolean` | `doubleEquals(double d1, double d2)` Determine if one double equals another, within the default percision.
`static double` | `factorial(int x)` Calculate x!.
`static double` | `hypot(double a, double b)` sqrt(a^2 + b^2) without under/overflow.
`static int` | `maxIndex(double[] array)` Get the index to the greatest number in a double array.
`static int` | `minIndex(double[] array)` Get the index to the smallest number in a double array.
`static double` | `rad2deg(double rad)` Convert radians to degrees.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### deg2rad

    public static double deg2rad(double deg)

  Convert degrees to radians.

  Parameters:
    `deg` - Degrees.
  Returns:
    Radians.

### doubleEquals

    public static boolean doubleEquals(double d1,
                                       double d2)

  Determine if one double equals another, within the default percision.

  Parameters:
    `d1` - The first number.
    `d2` - The second number.
  Returns:
    True if the two doubles are equal.

### hypot

    public static double hypot(double a,
                               double b)

  sqrt(a^2 + b^2) without under/overflow.

  Parameters:
    `a` - First param.
    `b` - Second param.
  Returns:
    The result.

### maxIndex

    public static int maxIndex(double[] array)

  Get the index to the greatest number in a double array.

  Parameters:
    `array` - The array to search.
  Returns:
    The index of the greatest value, or -1 if empty.

### minIndex

    public static int minIndex(double[] array)

  Get the index to the smallest number in a double array.

  Parameters:
    `array` - The array to search.
  Returns:
    The index of the smallest value, or -1 if empty.

### rad2deg

    public static double rad2deg(double rad)

  Convert radians to degrees.

  Parameters:
    `rad` - Radians
  Returns:
    Degrees.

### factorial

    public static double factorial(int x)

  Calculate x!.

  Parameters:
    `x` - The number to calculate for.
  Returns:
    The factorial of x.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011. All Rights Reserved.