Util
Date: 2019-10-22

org.jmol.minimize

## Class Util

- java.lang.Object
- - org.jmol.minimize.Util

-     public class Util
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `DEG_TO_RAD`
    `(package private) static double` | `max_squarable_double`
    `(package private) static double` | `min_squarable_double`
    `static double` | `RAD_TO_DEG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Util()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `canBeNormalized(javajs.util.V3d a)`
    `static boolean` | `canBeSquared(double x)`
    `static double` | `distance2(double[] a, double[] b)`
    `static double` | `distance2V(javajs.util.V3d a, javajs.util.V3d b)`
    `static double` | `getAngleRadiansABC(double[] a, double[] b, double[] c)`
    `static double` | `getTorsionAngleRadians(double[] a, double[] b, double[] c, double[] d, javajs.util.V3d r1, javajs.util.V3d r2, javajs.util.V3d r3)`
    `static boolean` | `isApprox(javajs.util.V3d a, javajs.util.V3d b, double precision)`
    `static boolean` | `isFinite(double a)`
    `static boolean` | `isNear(double a, double b)`
    `static boolean` | `isNear3(double a, double b, double epsilon)`
    `static boolean` | `isNearZero(double a)`
    `static boolean` | `isNearZero2(double a, double epsilon)`
    `static boolean` | `isNegligible(double a, double b)`
    `static boolean` | `isNegligible3(double a, double b, double precision)`
    `static double` | `pointPlaneAngleRadians(javajs.util.V3d a, javajs.util.V3d b, javajs.util.V3d c, javajs.util.V3d d, javajs.util.V3d v1, javajs.util.V3d v2, javajs.util.V3d norm, boolean fixTheta)` calculates angle of a to plane bcd, returning a value > pi/2 in highly distorted trigonal pyramidal situations
    `static void` | `putCoord(javajs.util.V3d v, double[] c)`
    `private static void` | `randomizeUnitVector(javajs.util.V3d v)`
    `static double` | `restorativeForceAndAngleRadians(javajs.util.V3d i, javajs.util.V3d j, javajs.util.V3d k)`
    `static double` | `restorativeForceAndDistance(javajs.util.V3d a, javajs.util.V3d b, javajs.util.V3d vab)`
    `static double` | `restorativeForceAndOutOfPlaneAngleRadians(javajs.util.V3d i, javajs.util.V3d j, javajs.util.V3d k, javajs.util.V3d l, javajs.util.V3d an, javajs.util.V3d bn, javajs.util.V3d cn)`
    `static double` | `restorativeForceAndTorsionAngleRadians(javajs.util.V3d i, javajs.util.V3d j, javajs.util.V3d k, javajs.util.V3d l)`
    `static void` | `sub(double[] a, double[] b, javajs.util.V3d result)`
    `private static double` | `vectorAngleRadians(javajs.util.V3d v1, javajs.util.V3d v2)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### RAD_TO_DEG

          public static final double RAD_TO_DEG

      See Also:
        Constant Field Values

    - #### DEG_TO_RAD

          public static final double DEG_TO_RAD

      See Also:
        Constant Field Values

    - #### max_squarable_double

          static final double max_squarable_double

      See Also:
        Constant Field Values

    - #### min_squarable_double

          static final double min_squarable_double

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Util

          public Util()

  - ### Method Detail

    - #### sub

          public static void sub(double[] a,
                                 double[] b,
                                 javajs.util.V3d result)

    - #### putCoord

          public static void putCoord(javajs.util.V3d v,
                                      double[] c)

    - #### distance2

          public static double distance2(double[] a,
                                         double[] b)

    - #### distance2V

          public static double distance2V(javajs.util.V3d a,
                                          javajs.util.V3d b)

    - #### getAngleRadiansABC

          public static double getAngleRadiansABC(double[] a,
                                                  double[] b,
                                                  double[] c)

    - #### isApprox

          public static boolean isApprox(javajs.util.V3d a,
                                         javajs.util.V3d b,
                                         double precision)

    - #### canBeSquared

          public static boolean canBeSquared(double x)

    - #### isNegligible

          public static boolean isNegligible(double a,
                                             double b)

    - #### isFinite

          public static boolean isFinite(double a)

    - #### isNegligible3

          public static boolean isNegligible3(double a,
                                              double b,
                                              double precision)

    - #### isNear

          public static boolean isNear(double a,
                                       double b)

    - #### isNear3

          public static boolean isNear3(double a,
                                        double b,
                                        double epsilon)

    - #### isNearZero

          public static boolean isNearZero(double a)

    - #### isNearZero2

          public static boolean isNearZero2(double a,
                                            double epsilon)

    - #### canBeNormalized

          public static boolean canBeNormalized(javajs.util.V3d a)

    - #### pointPlaneAngleRadians

          public static double pointPlaneAngleRadians(javajs.util.V3d a,
                                                      javajs.util.V3d b,
                                                      javajs.util.V3d c,
                                                      javajs.util.V3d d,
                                                      javajs.util.V3d v1,
                                                      javajs.util.V3d v2,
                                                      javajs.util.V3d norm,
                                                      boolean fixTheta)

      calculates angle of a to plane bcd, returning a value > pi/2 in highly distorted trigonal pyramidal situations
      Parameters:
        `a` -
        `b` -
        `c` -
        `d` -
        `v1` -
        `v2` -
        `norm` -
        `fixTheta` -
      Returns:
        Wilson angle

    - #### vectorAngleRadians

          private static double vectorAngleRadians(javajs.util.V3d v1,
                                                   javajs.util.V3d v2)

    - #### getTorsionAngleRadians

          public static double getTorsionAngleRadians(double[] a,
                                                      double[] b,
                                                      double[] c,
                                                      double[] d,
                                                      javajs.util.V3d r1,
                                                      javajs.util.V3d r2,
                                                      javajs.util.V3d r3)

    - #### restorativeForceAndDistance

          public static double restorativeForceAndDistance(javajs.util.V3d a,
                                                           javajs.util.V3d b,
                                                           javajs.util.V3d vab)

    - #### randomizeUnitVector

          private static void randomizeUnitVector(javajs.util.V3d v)

    - #### restorativeForceAndAngleRadians

          public static double restorativeForceAndAngleRadians(javajs.util.V3d i,
                                                               javajs.util.V3d j,
                                                               javajs.util.V3d k)

    - #### restorativeForceAndOutOfPlaneAngleRadians

          public static double restorativeForceAndOutOfPlaneAngleRadians(javajs.util.V3d i,
                                                                         javajs.util.V3d j,
                                                                         javajs.util.V3d k,
                                                                         javajs.util.V3d l,
                                                                         javajs.util.V3d an,
                                                                         javajs.util.V3d bn,
                                                                         javajs.util.V3d cn)

    - #### restorativeForceAndTorsionAngleRadians

          public static double restorativeForceAndTorsionAngleRadians(javajs.util.V3d i,
                                                                      javajs.util.V3d j,
                                                                      javajs.util.V3d k,
                                                                      javajs.util.V3d l)