org.jmol.util
Class Measure

java.lang.Object
  extended by org.jmol.util.Measure

public final class Measure
extends java.lang.Object


Field Summary
static float radiansPerDegree
           
 
Constructor Summary
Measure()
           
 
Method Summary
static void calcAveragePoint(javax.vecmath.Point3f pointA, javax.vecmath.Point3f pointB, javax.vecmath.Point3f pointC)
           
static void calcAveragePointN(javax.vecmath.Point3f[] points, int nPoints, javax.vecmath.Point3f averagePoint)
           
static void calcBestAxisThroughPoints(javax.vecmath.Point3f[] points, javax.vecmath.Point3f axisA, javax.vecmath.Vector3f axisUnitVector, javax.vecmath.Vector3f vectorProjection, int nTriesMax)
           
static void calcNormalizedNormal(javax.vecmath.Point3f pointA, javax.vecmath.Point3f pointB, javax.vecmath.Point3f pointC, javax.vecmath.Vector3f vNormNorm, javax.vecmath.Vector3f vAB, javax.vecmath.Vector3f vAC)
           
static Quaternion calculateQuaternionRotation(javax.vecmath.Point3f[][] centerAndPoints, float[] retStddev, boolean doReport)
           
static float computeAngle(javax.vecmath.Tuple3f pointA, javax.vecmath.Tuple3f pointB, javax.vecmath.Tuple3f pointC, boolean asDegrees)
           
static float computeAngle(javax.vecmath.Tuple3f pointA, javax.vecmath.Tuple3f pointB, javax.vecmath.Tuple3f pointC, javax.vecmath.Vector3f vectorBA, javax.vecmath.Vector3f vectorBC, boolean asDegrees)
           
static java.lang.Object computeHelicalAxis(java.lang.String id, int tokType, javax.vecmath.Point3f a, javax.vecmath.Point3f b, Quaternion dq)
           
static float computeTorsion(javax.vecmath.Tuple3f p1, javax.vecmath.Tuple3f p2, javax.vecmath.Tuple3f p3, javax.vecmath.Tuple3f p4, boolean asDegrees)
           
static float distanceToPlane(javax.vecmath.Point4f plane, float d, javax.vecmath.Point3f pt)
           
static float distanceToPlane(javax.vecmath.Point4f plane, javax.vecmath.Point3f pt)
           
static float distanceToPlane(javax.vecmath.Vector3f norm, float w, javax.vecmath.Point3f pt)
           
static float findAxis(javax.vecmath.Point3f[] points, int nPoints, javax.vecmath.Point3f axisA, javax.vecmath.Vector3f axisUnitVector, javax.vecmath.Vector3f vectorProjection)
           
static javax.vecmath.Point3f[] getCenterAndPoints(java.util.List<javax.vecmath.Point3f> vPts)
           
static float getDirectedNormalThroughPoints(javax.vecmath.Point3f pointA, javax.vecmath.Point3f pointB, javax.vecmath.Point3f pointC, javax.vecmath.Point3f ptRef, javax.vecmath.Vector3f vNorm, javax.vecmath.Vector3f vAB, javax.vecmath.Vector3f vAC)
           
static javax.vecmath.Point3f getIntersection(javax.vecmath.Point3f pt1, javax.vecmath.Vector3f v, javax.vecmath.Point4f plane, javax.vecmath.Point3f ptRet, javax.vecmath.Vector3f tempNorm, javax.vecmath.Vector3f vTemp)
           
static java.util.List<java.lang.Object> getIntersection(javax.vecmath.Point4f plane1, javax.vecmath.Point4f plane2)
           
static boolean getNormalFromCenter(javax.vecmath.Point3f ptCenter, javax.vecmath.Point3f ptA, javax.vecmath.Point3f ptB, javax.vecmath.Point3f ptC, boolean isOutward, javax.vecmath.Vector3f normal)
           
static float getNormalThroughPoints(javax.vecmath.Point3f pointA, javax.vecmath.Point3f pointB, javax.vecmath.Point3f pointC, javax.vecmath.Vector3f vNorm, javax.vecmath.Vector3f vAB, javax.vecmath.Vector3f vAC)
           
static void getNormalToLine(javax.vecmath.Point3f pointA, javax.vecmath.Point3f pointB, javax.vecmath.Vector3f vNormNorm)
           
static void getPlaneProjection(javax.vecmath.Point3f pt, javax.vecmath.Point4f plane, javax.vecmath.Point3f ptProj, javax.vecmath.Vector3f vNorm)
           
static void getPlaneThroughPoint(javax.vecmath.Point3f pt, javax.vecmath.Vector3f normal, javax.vecmath.Point4f plane)
           
static void getPlaneThroughPoints(javax.vecmath.Point3f pointA, javax.vecmath.Point3f pointB, javax.vecmath.Point3f pointC, javax.vecmath.Vector3f vNorm, javax.vecmath.Vector3f vAB, javax.vecmath.Vector3f vAC, javax.vecmath.Point4f plane)
           
static float getRmsd(javax.vecmath.Point3f[][] centerAndPoints, Quaternion q)
           
static float getTransformMatrix4(java.util.List<javax.vecmath.Point3f> ptsA, java.util.List<javax.vecmath.Point3f> ptsB, javax.vecmath.Matrix4f m, javax.vecmath.Point3f centerA)
           
static boolean isInTetrahedron(javax.vecmath.Point3f pt, javax.vecmath.Point3f ptA, javax.vecmath.Point3f ptB, javax.vecmath.Point3f ptC, javax.vecmath.Point3f ptD, javax.vecmath.Point4f plane, javax.vecmath.Vector3f vTemp, javax.vecmath.Vector3f vTemp2, javax.vecmath.Vector3f vTemp3, boolean fullyEnclosed)
           
static void projectOntoAxis(javax.vecmath.Point3f point, javax.vecmath.Point3f axisA, javax.vecmath.Vector3f axisUnitVector, javax.vecmath.Vector3f vectorProjection)
           
static java.util.List<javax.vecmath.Point3f> transformPoints(java.util.List<javax.vecmath.Point3f> vPts, javax.vecmath.Matrix4f m4, javax.vecmath.Point3f center)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radiansPerDegree

public static final float radiansPerDegree
See Also:
Constant Field Values
Constructor Detail

Measure

public Measure()
Method Detail

computeAngle

public static float computeAngle(javax.vecmath.Tuple3f pointA,
                                 javax.vecmath.Tuple3f pointB,
                                 javax.vecmath.Tuple3f pointC,
                                 javax.vecmath.Vector3f vectorBA,
                                 javax.vecmath.Vector3f vectorBC,
                                 boolean asDegrees)

computeAngle

public static float computeAngle(javax.vecmath.Tuple3f pointA,
                                 javax.vecmath.Tuple3f pointB,
                                 javax.vecmath.Tuple3f pointC,
                                 boolean asDegrees)

computeTorsion

public static float computeTorsion(javax.vecmath.Tuple3f p1,
                                   javax.vecmath.Tuple3f p2,
                                   javax.vecmath.Tuple3f p3,
                                   javax.vecmath.Tuple3f p4,
                                   boolean asDegrees)

computeHelicalAxis

public static java.lang.Object computeHelicalAxis(java.lang.String id,
                                                  int tokType,
                                                  javax.vecmath.Point3f a,
                                                  javax.vecmath.Point3f b,
                                                  Quaternion dq)

getPlaneThroughPoints

public static void getPlaneThroughPoints(javax.vecmath.Point3f pointA,
                                         javax.vecmath.Point3f pointB,
                                         javax.vecmath.Point3f pointC,
                                         javax.vecmath.Vector3f vNorm,
                                         javax.vecmath.Vector3f vAB,
                                         javax.vecmath.Vector3f vAC,
                                         javax.vecmath.Point4f plane)

getPlaneThroughPoint

public static void getPlaneThroughPoint(javax.vecmath.Point3f pt,
                                        javax.vecmath.Vector3f normal,
                                        javax.vecmath.Point4f plane)

distanceToPlane

public static float distanceToPlane(javax.vecmath.Point4f plane,
                                    javax.vecmath.Point3f pt)

distanceToPlane

public static float distanceToPlane(javax.vecmath.Point4f plane,
                                    float d,
                                    javax.vecmath.Point3f pt)

distanceToPlane

public static float distanceToPlane(javax.vecmath.Vector3f norm,
                                    float w,
                                    javax.vecmath.Point3f pt)

calcNormalizedNormal

public static void calcNormalizedNormal(javax.vecmath.Point3f pointA,
                                        javax.vecmath.Point3f pointB,
                                        javax.vecmath.Point3f pointC,
                                        javax.vecmath.Vector3f vNormNorm,
                                        javax.vecmath.Vector3f vAB,
                                        javax.vecmath.Vector3f vAC)

getDirectedNormalThroughPoints

public static float getDirectedNormalThroughPoints(javax.vecmath.Point3f pointA,
                                                   javax.vecmath.Point3f pointB,
                                                   javax.vecmath.Point3f pointC,
                                                   javax.vecmath.Point3f ptRef,
                                                   javax.vecmath.Vector3f vNorm,
                                                   javax.vecmath.Vector3f vAB,
                                                   javax.vecmath.Vector3f vAC)

getNormalThroughPoints

public static float getNormalThroughPoints(javax.vecmath.Point3f pointA,
                                           javax.vecmath.Point3f pointB,
                                           javax.vecmath.Point3f pointC,
                                           javax.vecmath.Vector3f vNorm,
                                           javax.vecmath.Vector3f vAB,
                                           javax.vecmath.Vector3f vAC)

getPlaneProjection

public static void getPlaneProjection(javax.vecmath.Point3f pt,
                                      javax.vecmath.Point4f plane,
                                      javax.vecmath.Point3f ptProj,
                                      javax.vecmath.Vector3f vNorm)

getNormalFromCenter

public static boolean getNormalFromCenter(javax.vecmath.Point3f ptCenter,
                                          javax.vecmath.Point3f ptA,
                                          javax.vecmath.Point3f ptB,
                                          javax.vecmath.Point3f ptC,
                                          boolean isOutward,
                                          javax.vecmath.Vector3f normal)
Parameters:
ptCenter -
ptA -
ptB -
ptC -
isOutward -
normal -
Returns:
true if winding is proper; false if not

getNormalToLine

public static void getNormalToLine(javax.vecmath.Point3f pointA,
                                   javax.vecmath.Point3f pointB,
                                   javax.vecmath.Vector3f vNormNorm)

projectOntoAxis

public static void projectOntoAxis(javax.vecmath.Point3f point,
                                   javax.vecmath.Point3f axisA,
                                   javax.vecmath.Vector3f axisUnitVector,
                                   javax.vecmath.Vector3f vectorProjection)

calcBestAxisThroughPoints

public static void calcBestAxisThroughPoints(javax.vecmath.Point3f[] points,
                                             javax.vecmath.Point3f axisA,
                                             javax.vecmath.Vector3f axisUnitVector,
                                             javax.vecmath.Vector3f vectorProjection,
                                             int nTriesMax)

findAxis

public static float findAxis(javax.vecmath.Point3f[] points,
                             int nPoints,
                             javax.vecmath.Point3f axisA,
                             javax.vecmath.Vector3f axisUnitVector,
                             javax.vecmath.Vector3f vectorProjection)

calcAveragePoint

public static void calcAveragePoint(javax.vecmath.Point3f pointA,
                                    javax.vecmath.Point3f pointB,
                                    javax.vecmath.Point3f pointC)

calcAveragePointN

public static void calcAveragePointN(javax.vecmath.Point3f[] points,
                                     int nPoints,
                                     javax.vecmath.Point3f averagePoint)

getCenterAndPoints

public static javax.vecmath.Point3f[] getCenterAndPoints(java.util.List<javax.vecmath.Point3f> vPts)

getTransformMatrix4

public static float getTransformMatrix4(java.util.List<javax.vecmath.Point3f> ptsA,
                                        java.util.List<javax.vecmath.Point3f> ptsB,
                                        javax.vecmath.Matrix4f m,
                                        javax.vecmath.Point3f centerA)

calculateQuaternionRotation

public static Quaternion calculateQuaternionRotation(javax.vecmath.Point3f[][] centerAndPoints,
                                                     float[] retStddev,
                                                     boolean doReport)

getRmsd

public static float getRmsd(javax.vecmath.Point3f[][] centerAndPoints,
                            Quaternion q)

transformPoints

public static java.util.List<javax.vecmath.Point3f> transformPoints(java.util.List<javax.vecmath.Point3f> vPts,
                                                                    javax.vecmath.Matrix4f m4,
                                                                    javax.vecmath.Point3f center)

isInTetrahedron

public static boolean isInTetrahedron(javax.vecmath.Point3f pt,
                                      javax.vecmath.Point3f ptA,
                                      javax.vecmath.Point3f ptB,
                                      javax.vecmath.Point3f ptC,
                                      javax.vecmath.Point3f ptD,
                                      javax.vecmath.Point4f plane,
                                      javax.vecmath.Vector3f vTemp,
                                      javax.vecmath.Vector3f vTemp2,
                                      javax.vecmath.Vector3f vTemp3,
                                      boolean fullyEnclosed)

getIntersection

public static java.util.List<java.lang.Object> getIntersection(javax.vecmath.Point4f plane1,
                                                               javax.vecmath.Point4f plane2)
Parameters:
plane1 -
plane2 -
Returns:
[ point, vector ] or []

getIntersection

public static javax.vecmath.Point3f getIntersection(javax.vecmath.Point3f pt1,
                                                    javax.vecmath.Vector3f v,
                                                    javax.vecmath.Point4f plane,
                                                    javax.vecmath.Point3f ptRet,
                                                    javax.vecmath.Vector3f tempNorm,
                                                    javax.vecmath.Vector3f vTemp)
Parameters:
pt1 - point on line
v - unit vector of line
plane -
ptRet - point of intersection of line with plane
tempNorm -
vTemp -
Returns:
ptRte