8 #ifndef IMPALGEBRA_SEGMENT_3D_H
9 #define IMPALGEBRA_SEGMENT_3D_H
11 #include <IMP/algebra/algebra_config.h>
19 IMPALGEBRA_BEGIN_NAMESPACE
33 Vector3D get_middle_point()
const {
return .5 * p_[0] + .5 * p_[1]; }
38 double get_length()
const;
40 { out << spaces_io(p_[0]) <<
": " << spaces_io(p_[1]); });
47 return BoundingBoxD<3>(g.get_point(0)) +
71 IMPALGEBRA_END_NAMESPACE
double get_distance(const Segment3D &a, const Segment3D &b)
Get the distance between two segments.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
#define IMP_LINEAR_GEOMETRY_METHODS(Name, name, bounding_box)
Implement the needed namespace methods for a geometry type.
#define IMP_INTERNAL_CHECK(expr, message)
An assertion to check for internal errors in IMP. An IMP::ErrorException will be thrown.
Base class for geometric types.
Vector3D get_direction() const
Get a normalized direction vector pointing from get_point(0) to get_point(1).
A bounding box in D dimensions.
Various useful constants.
Simple implementation of segments in 3D.
double get_relative_projection_on_segment(const Segment3D &s, const algebra::Vector3D &p)
Various important macros for implementing geometry.
const Vector3D & get_point(unsigned int i) const
Get the start=0/end=1 point of the segment.