8#ifndef IMPKERNEL_VECTOR_3D_H
9#define IMPKERNEL_VECTOR_3D_H
20IMPKERNEL_BEGIN_NAMESPACE
32 return Vector3D(p1[1] * p2[2] - p1[2] * p2[1], p1[2] * p2[0] - p1[0] * p2[2],
33 p1[0] * p2[1] - p1[1] * p2[0]);
51 unsigned int maxi = 0;
52 if (std::abs(v[1]) > std::abs(v[0])) maxi = 1;
53 if (std::abs(v[2]) > std::abs(v[maxi])) maxi = 2;
54 if (std::abs(v[maxi]) < .0001) {
58 ret[maxi] = (-v[(maxi + 1) % 3] - v[(maxi + 2) % 3]) / v[maxi];
79 for (
unsigned int i = 0; i < ps.size(); i++) {
88IMPKERNEL_END_NAMESPACE
Various general useful macros for IMP.
#define IMP_INTERNAL_CHECK(expr, message)
An assertion to check for internal errors in IMP. An IMP::ErrorException will be thrown.
Exception definitions and assertions.
Vector3D get_orthogonal_vector(const Vector3D &v)
Return a vector that is perpendicular to the given vector.
Vector< VectorD< 3 > > Vector3Ds
double get_squared_distance(const VectorD< D > &v1, const VectorD< D > &v2)
Compute the squared distance between two vectors.
VectorD< D > get_ones_vector_d(double v=1)
Return a vector of ones (or another constant).
double get_radius_of_gyration(const Vector3Ds &ps)
Return the radius of gyration of a set of points.
VectorD< D > get_zero_vector_d()
Return a vector of zeros.
Vector3D get_vector_product(const Vector3D &p1, const Vector3D &p2)
Return the vector product (cross product) of two vectors.
Vector3D get_centroid(const Vector3Ds &ps)
Return the centroid of a set of vectors.