Struct TPlane
Defined in File TPlane.h
Struct Documentation
-
struct TPlane
3D Plane, represented by its equation \(Ax+By+Cz+D=0\)
See also
Public Functions
-
TPlane() = default
Fast default constructor (uninitialized coefficients).
-
inline constexpr TPlane(double A, double B, double C, double D)
Constructor from plane coefficients
-
inline TPlane(const double (&vec)[4])
Constructor from an array of coefficients (A,B,C,D).
-
TPlane(const TPoint3D &p1, const TPoint3D &p2, const TPoint3D &p3)
Defines a plane which contains these three points.
See also
mrpt::math::getRegressionPlane()
- Throws:
std::logic_error – if the points are linearly dependants.
-
TPlane(const TPoint3D &p1, const TVector3D &normal)
Defines a plane given a point and a normal vector (must not be unit).
- Throws:
std::logic_error – if the normal vector is null
-
TPlane(const TPoint3D &p1, const TLine3D &r2)
Defines a plane which contains this point and this line.
- Throws:
std::logic_error – if the point is inside the line.
-
TPlane(const TLine3D &r1, const TLine3D &r2)
Defines a plane which contains the two lines.
- Throws:
std::logic_error – if the lines do not cross.
-
inline bool contains(const TSegment3D &segment) const
Check whether a segment is fully contained into the plane.
-
double signedDistance(const TPoint3D &point) const
Signed distance (positive on the normal vector side) to 3D point.
Note
(New in MRPT 2.4.9)
-
double distance(const TLine3D &line) const
Distance to 3D line. Will be zero if the line is not parallel to the plane.
-
void unitarize()
Unitarize normal vector.
-
std::string asString() const
Returns “[A, B, C, D]”
Note
[New in MRPT 2.1.0]
Public Members
-
std::array<double, 4> coefs{{.0, .0, .0, .0}}
Plane coefficients, stored as an array: \(\left[A,B,C,D\right]\)
Public Static Functions
-
static inline TPlane From3Points(const TPoint3D &p1, const TPoint3D &p2, const TPoint3D &p3)
See also
mrpt::math::getRegressionPlane()
Note
[New in MRPT 2.1.0]
-
static inline TPlane FromPointAndNormal(const TPoint3D &p1, const TVector3D &normal)
Note
[New in MRPT 2.1.0]
-
TPlane() = default