$darkmode
DENOPTIM
|
Some useful math operations. More...
Static Public Member Functions | |
static double | calculateAngle (double[] a, double[] b) |
compute the angle between two vectors a & b of same length More... | |
static void | norm (double[] d, double[] ret) |
Normalizes a vector. More... | |
static Vector3d | normDist (Point3d p1, Point3d p2) |
Get normalized distance between two point. More... | |
static double[] | scale (double[] d, double a) |
Scales a vector. More... | |
static void | scalar (double[] d, double a, double[] ret) |
Scales a vector. More... | |
static double | length (double[] v) |
Return the norm of a vector. More... | |
static double | computeDotProduct (double[] v0, double[] v1) |
Compute the dot product (a scalar) between two vectors. More... | |
static double[] | computeCrossProduct (double[] v0, double[] v1) |
Compute the cross product of two vectors. More... | |
static double[] | subtract (double[] v0, double[] v1) |
Perform vector subtraction. More... | |
static double[] | add (double[] v0, double[] v1) |
Perform vector addition. More... | |
static double | computeDihedralAngle (Point3d p0, Point3d p1, Point3d p2, Point3d p3) |
Compute the dihedral angle. More... | |
static double | computeDihedralAngle (double[] v0, double[] v1, double[] v2, double[] v3) |
Compute the dihedral angle. More... | |
static double | log2 (double x) |
static double | roundValue (double val, int decimalPlaces) |
static double | angle (Point3d a, Point3d b, Point3d c) |
Calculate the angle between the 3 points. More... | |
static double | getAngle (double[] A, double[] B, double[] C) |
Calculates angle (in degrees) between vectors BA and BC. More... | |
static double | distance (Point3d a, Point3d b) |
Calculates distance between point a and point b. More... | |
static double | torsion (Point3d p1, Point3d p2, Point3d p3, Point3d p4) |
Calculate the torsion angle between the 4 points. More... | |
static double | sum (double[] a) |
Return sum of all values in array. More... | |
static double | mean (double[] a) |
Calculate mean value. More... | |
static double | mean (List< Double > vals) |
static Vector3d | getNormalDirection (Vector3d vecA) |
Generate a vector that is perpendicular to the given one. More... | |
static double[] | centroidOf (Collection< double[]> points, int dimension) |
Static Private Attributes | |
static final double[] | tp1 = new double[3] |
static final double[] | tp2 = new double[3] |
static final double[] | tp3 = new double[3] |
static final double[] | tp4 = new double[3] |
Some useful math operations.
Definition at line 38 of file MathUtils.java.
|
static |
Perform vector addition.
v0 | First vector |
v1 | Second vector |
Definition at line 198 of file MathUtils.java.
Referenced by denoptim.gui.FragmentViewPanel.updateAPsInJmolViewer().
|
static |
Calculate the angle between the 3 points.
a | |
b | |
c |
Definition at line 284 of file MathUtils.java.
References denoptim.utils.MathUtils.angle(), and denoptim.constants.DENOPTIMConstants.FLOATCOMPARISONTOLERANCE.
Referenced by denoptim.utils.DummyAtomHandler.addDummiesOnLinearities(), denoptim.utils.MathUtils.angle(), denoptim.utils.MathUtils.calculateAngle(), denoptim.graph.rings.RingClosureFinder.evaluateClosability(), denoptim.integration.tinker.TinkerUtils.getICFromIAC(), and denoptim.integration.tinker.TinkerUtils.getThirdRefAtomId().
|
static |
compute the angle between two vectors a & b of same length
a | |
b |
Definition at line 51 of file MathUtils.java.
References denoptim.utils.MathUtils.angle(), denoptim.utils.MathUtils.computeDotProduct(), and denoptim.utils.MathUtils.length().
Referenced by denoptim.utils.MathUtils.getAngle().
|
static |
Definition at line 457 of file MathUtils.java.
Referenced by denoptim.fragmenter.DynamicCentroidCluster.getCentroid(), and denoptim.fragmenter.FragmentClusterer.getRMSDStatsOfNoisyDistorsions().
|
static |
Compute the cross product of two vectors.
Result is a vector
v0 | First vector |
v1 | Second vector |
Definition at line 162 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.computeDihedralAngle().
|
static |
Compute the dihedral angle.
v0 | 3D coordinates |
v1 | 3D coordinates |
v2 | 3D coordinates |
v3 | 3D coordinates |
Definition at line 241 of file MathUtils.java.
References denoptim.utils.MathUtils.computeCrossProduct(), denoptim.utils.MathUtils.computeDotProduct(), and denoptim.utils.MathUtils.subtract().
|
static |
Compute the dihedral angle.
p0 | point in 3D |
p1 | point in 3D |
p2 | point in 3D |
p3 | point in 3D |
Definition at line 218 of file MathUtils.java.
References denoptim.utils.MathUtils.computeDihedralAngle().
Referenced by denoptim.utils.MathUtils.computeDihedralAngle(), denoptim.graph.rings.RingClosureFinder.evaluateClosability(), and denoptim.utils.MathUtils.torsion().
|
static |
Compute the dot product (a scalar) between two vectors.
v0 | First vector |
v1 | Second vector |
Definition at line 148 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.calculateAngle(), and denoptim.utils.MathUtils.computeDihedralAngle().
|
static |
Calculates distance between point a and point b.
a | Point |
b | Point |
Definition at line 342 of file MathUtils.java.
Referenced by denoptim.graph.Fragment.is3D(), and denoptim.molecularmodeling.ChemicalObjectModel.updateXYZFromINT().
|
static |
Calculates angle (in degrees) between vectors BA and BC.
A | Point |
B | Point |
C | Point |
Definition at line 324 of file MathUtils.java.
References denoptim.utils.MathUtils.calculateAngle().
|
static |
Generate a vector that is perpendicular to the given one.
No control over which perpendicular direction will be chosen.
vecA | input vector |
Definition at line 426 of file MathUtils.java.
Referenced by denoptim.molecularmodeling.ThreeDimTreeBuilder.append3DFragmentsViaEdges().
|
static |
Return the norm of a vector.
v | Vector to compute length of. |
Definition at line 134 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.calculateAngle(), and denoptim.utils.MathUtils.norm().
|
static |
Definition at line 260 of file MathUtils.java.
|
static |
Calculate mean value.
a | Array to calculate mean from. |
Definition at line 396 of file MathUtils.java.
References denoptim.utils.MathUtils.sum().
Referenced by denoptim.fitness.FitnessProvider.getFitness(), and denoptim.utils.MathUtils.mean().
|
static |
Definition at line 406 of file MathUtils.java.
References denoptim.utils.MathUtils.mean().
|
static |
Normalizes a vector.
d | A vector to be normalized. |
ret | The normalized vector. |
Definition at line 67 of file MathUtils.java.
References denoptim.utils.MathUtils.length().
|
static |
Get normalized distance between two point.
p1 | the first point |
p2 | the second point |
Definition at line 86 of file MathUtils.java.
Referenced by denoptim.molecularmodeling.ChemicalObjectModel.updateXYZFromINT().
|
static |
Definition at line 268 of file MathUtils.java.
|
static |
Scales a vector.
d | A vector to be scaled |
a | A scaling value |
ret | The scaled vector |
Definition at line 119 of file MathUtils.java.
|
static |
Scales a vector.
d | A vector to be scaled |
a | A scaling value |
Definition at line 102 of file MathUtils.java.
Referenced by denoptim.gui.FragmentViewPanel.updateAPsInJmolViewer().
|
static |
Perform vector subtraction.
v0 | Vector to subtract from |
v1 | Vector to subtract |
Definition at line 180 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.computeDihedralAngle(), and denoptim.gui.FragmentViewPanel.updateAPsInJmolViewer().
|
static |
Return sum of all values in array.
a | Array to sum elements of. |
Definition at line 380 of file MathUtils.java.
References denoptim.utils.MathUtils.sum().
Referenced by denoptim.utils.MathUtils.mean(), and denoptim.utils.MathUtils.sum().
|
static |
Calculate the torsion angle between the 4 points.
p1 | Point |
p2 | Point |
p3 | Point |
p4 | Point |
Definition at line 363 of file MathUtils.java.
References denoptim.utils.MathUtils.computeDihedralAngle(), denoptim.utils.MathUtils.tp1, denoptim.utils.MathUtils.tp2, denoptim.utils.MathUtils.tp3, and denoptim.utils.MathUtils.tp4.
Referenced by denoptim.integration.tinker.TinkerUtils.getICFromIAC().
|
staticprivate |
Definition at line 350 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.torsion().
|
staticprivate |
Definition at line 351 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.torsion().
|
staticprivate |
Definition at line 352 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.torsion().
|
staticprivate |
Definition at line 353 of file MathUtils.java.
Referenced by denoptim.utils.MathUtils.torsion().