8 #ifndef IMPALGEBRA_SEGMENT_3D_H
9 #define IMPALGEBRA_SEGMENT_3D_H
11 #include <IMP/algebra/algebra_config.h>
19 IMPALGEBRA_BEGIN_NAMESPACE
29 #if defined(IMP_SWIG_WRAPPER)
36 Vector3D get_middle_point()
const {
return .5 * p_[0] + .5 * p_[1]; }
41 double get_length()
const;
43 { out << spaces_io(p_[0]) <<
": " << spaces_io(p_[1]); });
50 Segment3D, segment_3d,
74 IMPALGEBRA_END_NAMESPACE
#define IMP_LINEAR_GEOMETRY_METHODS(Name, name, bounding_box)
implement the needed namespace methods for a geometry type
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
double get_distance(const Plane3D &pln, const Vector3D &p)
Return the distance between a plane and a point in 3D.
Vector3D get_direction() const
Get a normalized direction vector pointing from get_point(0) to get_point(1).
#define IMP_INTERNAL_CHECK(expr, message)
An assertion to check for internal errors in IMP. An IMP::ErrorException will be thrown.
A bounding box in D dimensions.
Various useful constants.
double get_relative_projection_on_segment(const Segment3D &s, const algebra::Vector3D &p)
VectorD get_unit_vector() const
Various important macros for implementing geometry.
const Vector3D & get_point(unsigned int i) const
Get the start=0/end=1 point of the segment.