# Class Util

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

public class Util extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final double`
`DEG_TO_RAD`
`static final double`
`RAD_TO_DEG`

## Constructor Summary

Constructors
Constructor
Description
`Util()`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`canBeNormalized(V3d a)`
`static boolean`
`canBeSquared(double x)`
`static double`
`distance2(double[] a, double[] b)`
`static double`
`distance2V(V3d a, V3d b)`
`static double`
`getAngleRadiansABC(double[] a, double[] b, double[] c)`
`static double`
`getTorsionAngleRadians(double[] a, double[] b, double[] c, double[] d, V3d r1, V3d r2, V3d r3)`
`static boolean`
`isApprox(V3d a, 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(V3d a, V3d b, V3d c, V3d d, V3d v1, V3d v2, 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(V3d v, double[] c)`
`static double`
`restorativeForceAndAngleRadians(V3d i, V3d j, V3d k)`
`static double`
`restorativeForceAndDistance(V3d a, V3d b, V3d vab)`
`static double`
`restorativeForceAndOutOfPlaneAngleRadians(V3d i, V3d j, V3d k, V3d l, V3d an, V3d bn, V3d cn)`
`static double`
`restorativeForceAndTorsionAngleRadians(V3d i, V3d j, V3d k, V3d l)`
`static void`
`sub(double[] a, double[] b, V3d result)`

### Methods inherited from class Object

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

## Field Details

### 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

## Constructor Details

### Util

public Util()

## Method Details

### sub

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

### putCoord

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

### distance2

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

### distance2V

public static double distance2V(V3d a, V3d b)

### getAngleRadiansABC

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

### isApprox

public static boolean isApprox(V3d a, 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(V3d a)

### pointPlaneAngleRadians

public static double pointPlaneAngleRadians(V3d a, V3d b, V3d c, V3d d, V3d v1, V3d v2, 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

### getTorsionAngleRadians

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

### restorativeForceAndDistance

public static double restorativeForceAndDistance(V3d a, V3d b, V3d vab)

### restorativeForceAndAngleRadians

public static double restorativeForceAndAngleRadians(V3d i, V3d j, V3d k)

### restorativeForceAndOutOfPlaneAngleRadians

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

### restorativeForceAndTorsionAngleRadians

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