8 #ifndef IMPALGEBRA_PLANE_3D_H
9 #define IMPALGEBRA_PLANE_3D_H
11 #include <IMP/algebra/algebra_config.h>
16 IMPALGEBRA_BEGIN_NAMESPACE
25 : normal_(normal_to_plane) {
26 distance_ = normal_ * point_on_plane;
28 "The normal vector must be normalized");
31 : distance_(distance_to_plane), normal_(normal_to_plane) {
33 "The normal vector must be normalized");
35 Vector3D get_point_on_plane()
const {
return normal_ * distance_; }
36 const Vector3D &get_normal()
const {
return normal_; }
39 return p - normal_ * (normal_ * p - distance_);
49 bool get_is_above(
const Vector3D &p)
const {
return get_height(p) > 0; }
50 bool get_is_below(
const Vector3D &p)
const {
return get_height(p) < 0; }
52 double get_height(
const Vector3D &p)
const {
return normal_ * p - distance_; }
54 { out <<
"(" << distance_ <<
": " << spaces_io(normal_) <<
")"; });
58 double get_distance_from_origin()
const {
return distance_; }
68 return (pln.get_projection(p) - p).get_magnitude();
74 return p + 2 * (proj - p);
78 return std::numeric_limits<double>::infinity(), {
80 Vector3D ip = get_ones_vector_d<3>(std::numeric_limits<double>::infinity());
83 IMPALGEBRA_END_NAMESPACE
BoundingBoxD< 3 > BoundingBox3D
void get_projection(em2d::Image *img, const kernel::ParticlesTemp &ps, const RegistrationResult ®, const ProjectingOptions &options, MasksManagerPtr masks=MasksManagerPtr(), String name="")
Generates a projection from particles.
#define IMP_UNUSED(variable)
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Vector3D get_reflected(const Plane3D &pln, const Vector3D &p)
return the point reflected about the plane
#define IMP_USAGE_CHECK_FLOAT_EQUAL(expra, exprb, message)
#define IMP_AREA_GEOMETRY_METHODS(Name, name, area, bounding_box)
implement the needed namespace methods for a geometry type
double get_distance(const Plane3D &pln, const Vector3D &p)
Return the distance between a plane and a point in 3D.
Plane3D get_opposite() const
Return the plane with the opposite normal.
A bounding box in D dimensions.
Vector3D get_projected(const Vector3D &p) const
Project the point onto the plane.