32 for (
int ind=0; ind<3; ++ind) {
33 if (lhs[ind] < rhs[ind]) {
42 for (
int axis = 0; axis<3; ++axis) {
52 std::pair<double, double>
mm =
std::minmax(bounds.first[axis], bounds.second[axis]);
53 return mm.first <= point[axis] && point[axis] <= mm.second;
59 return acos(axis.
dot(vector));
64 return (ray.second - ray.first).magnitude();
69 return ray.second - ray.first;
83 const double d = u.
dot(w0),
e = v.
dot(w0);
85 const double denom = a*
c -
b*
b;
88 return Ray(pu.first, qv.first + t*v);
90 const double s = (b*
e -
c*
d) / denom;
91 const double t = (a*
e - b*
d) / denom;
92 return Ray(pu.first + s*u, qv.first + t*v);
104 return diff.x() * diff.y() * diff.z();
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
std::pair< float, float > minmax(const float a, const float b)
minmax
bool operator()(const Point &lhs, const Point &rhs) const
WireCell::PointF a_sad_little_point
WireCell::PointValueVector a_point_value_vector
std::pair< Point, float > PointValue
PointValue - an association of a point and a value.
std::vector< PointValue > PointValueVector
PointValueVector - a collection of point-value associations.
double ray_dist(const Ray &ray, const Point &point)
double ray_volume(const Ray &ray)
double ray_length(const Ray &ray)
D3Vector norm() const
Return a normalized vector in the direction of this vector.
Vector ray_unit(const Ray &ray)
WireCell::PointValue a_point_value
BoundingBox bounds(int x, int y, int w, int h)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
std::vector< Point > PointVector
PointVector - a collection of Points.
Ray ray_pitch(const Ray &ray1, const Ray &ray2)
T dot(const D3Vector &rhs) const
Return the dot product of this vector and the other.
WireCell::PointVector a_point_vector
double point_angle(const Vector &axis, const Vector &vector)
bool point_contained(const Point &point, const Ray &bounds)
Vector ray_vector(const Ray &ray)