IMP  2.0.1
The Integrative Modeling Platform
Reflection3D.h
Go to the documentation of this file.
1 /**
2  * \file IMP/algebra/Reflection3D.h \brief Reflect about a plane in 3D.
3  *
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPALGEBRA_REFLECTION_3D_H
9 #define IMPALGEBRA_REFLECTION_3D_H
10 
11 #include <IMP/algebra/algebra_config.h>
12 #include "Plane3D.h"
13 #include "GeometricPrimitiveD.h"
14 
15 IMPALGEBRA_BEGIN_NAMESPACE
16 
17 //! Reflect about a plane in 3D
18 /**
19 */
21 {
22  Plane3D pl_;
23 public:
24  Reflection3D(){}
25  Reflection3D(Plane3D pl): pl_(pl){}
26 
27  Vector3D get_reflected(const Vector3D &v) const {
28  Vector3D p= pl_.get_projection(v);
29  return v+2*(p-v);
30  }
32  out << pl_;
33  }
34  );
35 };
36 
38 
39 IMPALGEBRA_END_NAMESPACE
40 
41 #endif /* IMPALGEBRA_REFLECTION_3D_H */