Class Measure
java.lang.Object
javajs.util.Measure
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcalcAveragePoint(P3 pointA, P3 pointB, P3 pointC) static voidcalcAveragePointN(P3[] points, int nPoints, P3 averagePoint) static voidcalcBestAxisThroughPoints(P3[] points, int nPoints, P3 axisA, V3 axisUnitVector, V3 vectorProjection, int nTriesMax) static floatcalcBestPlaneThroughPoints(P3[] points, int nPoints, P4 plane) Calculate the best ax + by + cz + d = 0 plane through a number of points using a three-step check for the best plane based on normal distance.static voidnote that if vAB or vAC is dispensible, vNormNorm can be one of themstatic floatcalcPlaneForMode(P3[] points, int nPoints, P4 plane, char mode) Compact calculation of the best pane using a simple method discussed at https://stackoverflow.com/questions/12299540/plane-fitting-to-4-or-more-xyz-points (A^T A)^-1 A^T B run three times to ensure that at least one is not perpendicular.static QuatcalculateQuaternionRotation(P3[][] centerAndPoints, float[] retStddev) Closed-form solution of absolute orientation requiring 1:1 mapping of positions.static floatstatic floatcomputeAngleABC(T3 pointA, T3 pointB, T3 pointC, boolean asDegrees) static T3[]computeHelicalAxis(P3 a, P3 b, Quat dq) This method calculates measures relating to two points in space with related quaternion frame difference.static floatcomputeTorsion(T3 p1, T3 p2, T3 p3, T3 p4, boolean asDegrees) static floatdirectedDistanceToPlane(P3 pt, P4 plane, P3 ptref) static floatdistanceToPlane(P4 plane, T3 pt) static floatdistanceToPlaneD(P4 plane, float d, P3 pt) static floatdistanceToPlaneV(V3 norm, float w, P3 pt) static floatstatic P3[]getBestLineThroughPoints(P3[] points, int nPoints) Get the endpoints of the best line through N points, where N >= 2static voidstatic P3[]getCenterAndPoints(Lst<P3> vPts) from a list of points, create an array that includes the center point as the first point.static floatstatic P3Calculate the intersection of a line with a plane.getIntersectionPP(P4 plane1, P4 plane2) Calculate the line that is the intersection of two planes.getLatticePoints(Lst<P3> cpts, int h, int k, int l) Based on a set of centering points, creates a list of lattice points in place.static booleanstatic floatstatic voidgetNormalToLine(P3 pointA, P3 pointB, V3 vNormNorm) static floatgetPlaneProjection(T3 pt, P4 plane, T3 retPtProj, V3 retNorm) Project a point onto a plane, also returning the normal vector and the directed distance to the plane.static voidgetPlaneThroughPoint(T3 pt, V3 normal, P4 plane) static P4getPointsOnPlane(P3[] pts, P4 plane) Based on a set of centering points, returns the list of points on a given plane.static P3[]getProjectedLineSegment(P3[] points, int nPoints, P3 ptA, V3 unitVector, V3 vTemp) static floatstatic floatFills a 4x4 matrix with rotation-translation of mapped points A to B.static booleanisInTetrahedron(P3 pt, P3 ptA, P3 ptB, P3 ptC, P3 ptD, P4 plane, V3 vTemp, V3 vTemp2, boolean fullyEnclosed) static booleanstatic floatprojectOntoAxis(P3 pt, P3 ptA, V3 axisUnitVector, V3 vectorProjection) project point onto a line containing ptA and having axis unitVector axisUnitVector, returning the result in point and a vector from ptA to pt in vectorProjectionstatic voidtest()transformPoints(Lst<P3> vPts, M4 m4, P3 center)
-
Field Details
-
radiansPerDegree
public static final float radiansPerDegree- See Also:
-
axisY
-
-
Constructor Details
-
Measure
public Measure()
-
-
Method Details
-
computeAngle
-
computeAngleABC
-
computeTorsion
-
getPlaneThroughPoints
-
getPlaneThroughPoint
-
distanceToPlane
-
directedDistanceToPlane
-
distanceToPlaneD
-
distanceToPlaneV
-
calcNormalizedNormal
-
getDirectedNormalThroughPoints
-
getNormalThroughPoints
-
getPlaneProjection
Project a point onto a plane, also returning the normal vector and the directed distance to the plane.- Parameters:
pt-plane-retPtProj- returned pt (can be pt)retNorm- returned normal vector- Returns:
- directed distance to plane
-
getNormalFromCenter
-
getNormalToLine
-
getBisectingPlane
-
projectOntoAxis
project point onto a line containing ptA and having axis unitVector axisUnitVector, returning the result in point and a vector from ptA to pt in vectorProjection- Parameters:
pt- input pt to be projected, returns projectedptA- input point on lineaxisUnitVector- input unit vectorvectorProjection- return for pt.sub(ptA)- Returns:
- projected distance
-
calcBestAxisThroughPoints
-
findAxis
-
calcAveragePoint
-
calcAveragePointN
-
transformPoints
-
isInTetrahedron
-
getIntersectionPP
-
getIntersection
-
calculateQuaternionRotation
-
getTransformMatrix4
Fills a 4x4 matrix with rotation-translation of mapped points A to B. If centerA is null, this is a standard 4x4 rotation-translation matrix; otherwise, this 4x4 matrix is a rotation around a vector through the center of ptsA, and centerA is filled with that center; Prior to Jmol 14.3.12_2014.02.14, when used from the JmolScript compare() function, this method returned the second of these options instead of the first.- Parameters:
ptsA-ptsB-m- 4x4 matrix to be returnedcenterA- return center of rotation; if null, then standard 4x4 matrix is returned- Returns:
- stdDev
-
getCenterAndPoints
-
getRmsd
-
getBestLineThroughPoints
-
getProjectedLineSegment
-
isInTriangle
-
calcBestPlaneThroughPoints
Calculate the best ax + by + cz + d = 0 plane through a number of points using a three-step check for the best plane based on normal distance. this simple calculation isn't perfect, but it does the job quickly and with no need for a full singular value decomposition.- Parameters:
points-nPoints-plane-- Returns:
- RMSD for the best plane along with filling the plane itself
-
calcPlaneForMode
Compact calculation of the best pane using a simple method discussed at https://stackoverflow.com/questions/12299540/plane-fitting-to-4-or-more-xyz-points (A^T A)^-1 A^T B run three times to ensure that at least one is not perpendicular.- Parameters:
points-nPoints-plane- filled with best planemode-- Returns:
- rmsd
-
test
public static void test() -
getPointsOnPlane
-
getLatticePoints
-
computeHelicalAxis
This method calculates measures relating to two points in space with related quaternion frame difference. It is used in Jmol for calculating straightness and many other helical quantities.- Parameters:
a-b-dq-- Returns:
- new T3[] { pt_a_prime, n, r, P3.new3(theta, pitch, residuesPerTurn), pt_b_prime };
-