PolyhedronStereoSorter
Date: 2019-10-22

org.jmol.smiles

## Class PolyhedronStereoSorter

- java.lang.Object
- - org.jmol.smiles.PolyhedronStereoSorter

- All Implemented Interfaces:
    java.util.Comparator<java.lang.Object[]>

      class PolyhedronStereoSorter
      extends java.lang.Object
      implements java.util.Comparator<java.lang.Object[]>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private javajs.util.V3` | `align1`
    `private javajs.util.V3` | `align2`
    `private static float` | `MIN_ALIGNED`
    `private javajs.util.V3` | `vRef`
    `private javajs.util.V3` | `vTemp`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PolyhedronStereoSorter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(java.lang.Object[] a, java.lang.Object[] b)` Comparison is by torsion angle, as set previously and passed in as Float a[1] and b[1].
    `(package private) boolean` | `isAligned(javajs.util.T3 pt1, javajs.util.T3 pt2, javajs.util.T3 pt3)` check alignment, within 10 degrees is considered aligned.
    `(package private) void` | `setRef(javajs.util.V3 vRef)`

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

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

    - ### Methods inherited from interface java.util.Comparator

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Field Detail

    - #### vTemp

          private javajs.util.V3 vTemp

    - #### vRef

          private javajs.util.V3 vRef

    - #### align1

          private javajs.util.V3 align1

    - #### align2

          private javajs.util.V3 align2

    - #### MIN_ALIGNED

          private static final float MIN_ALIGNED

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PolyhedronStereoSorter

          PolyhedronStereoSorter()

  - ### Method Detail

    - #### setRef

          void setRef(javajs.util.V3 vRef)

    - #### compare

          public int compare(java.lang.Object[] a,
                             java.lang.Object[] b)

      Comparison is by torsion angle, as set previously and passed in as Float a[1] and b[1]. If these two are within 1 degree of each other, then we compare the dot product of the reference vector and the vector from a to b, from points stored as a[2] and b[2].
      Specified by:
        `compare` in interface `java.util.Comparator<java.lang.Object[]>`

    - #### isAligned

          boolean isAligned(javajs.util.T3 pt1,
                            javajs.util.T3 pt2,
                            javajs.util.T3 pt3)

      check alignment, within 10 degrees is considered aligned.
      Parameters:
        `pt1` -
        `pt2` -
        `pt3` -
      Returns:
        true if within 10 degrees