Template Struct TPoint3D_
Defined in File TPoint3D.h
Inheritance Relationships
Base Types
public mrpt::math::TPoseOrPoint(Struct TPoseOrPoint)public mrpt::math::TPoint3D_data< T >(Template Struct TPoint3D_data)public mrpt::math::internal::ProvideStaticResize< TPoint3D_< T > >(Template Struct ProvideStaticResize)
Struct Documentation
-
template<typename T>
struct TPoint3D_ : public mrpt::math::TPoseOrPoint, public mrpt::math::TPoint3D_data<T>, public mrpt::math::internal::ProvideStaticResize<TPoint3D_<T>> Base template for TPoint3D (double) and TPoint3Df (float).
Represents a point (or free vector) in the 3D Euclidean space R^3. Coordinates are stored as
(x, y, z)in a 1-byte-packed struct (no padding).This is a lightweight POD-like type intended for storage, arithmetic, and interoperability with NumPy / Eigen arrays. It supports:
Standard vector arithmetic (+, -, scalar *, /).
Euclidean norm and distance queries.
std::tuple structured-binding (
auto [x,y,z] = pt;).
When applying SE(3) rigid-body transformations, use mrpt::poses::CPose3D::composePoint() or mrpt::math::TPose3D::composePoint() rather than adding translation manually.
See also
Note
TVector3Dis a type alias forTPoint3D(same storage; use that name when the object is a free vector, e.g. a linear velocity or surface normal).Public Functions
-
inline constexpr TPoint3D_()
Default constructor. Initializes to zeros.
-
template<typename U>
inline TPoint3D_(const TPoint3D_data<U> &p) Constructor from coordinates.
-
template<typename U>
inline explicit TPoint3D_(const mrpt::math::CMatrixFixed<U, 3, 1> &m) Constructor from column vector.
-
explicit TPoint3D_(const TPoint2D_<T> &p)
Constructor from TPoint2D; the z coordinate is set to zero.
See also
-
explicit TPoint3D_(const TPose2D &p)
Constructor from TPose2D; retains (x,y) from the translational part and sets z=0; the heading angle phi is discarded.
See also
-
explicit TPoint3D_(const TPose3D &p)
Constructor from TPose3D; retains only the translational part (x,y,z); all angular coordinates (yaw, pitch, roll) are discarded.
See also
-
template<typename U>
inline TPoint3D_<U> cast() const Return a copy of this object using type U for coordinates
-
inline constexpr auto as_tuple() const
-
template<typename Vector>
inline void asVector(Vector &v) const Gets the pose as a vector of doubles.
- Template Parameters:
Vector – It can be std::vector<double>, Eigen::VectorXd, etc.
-
template<typename Vector>
inline Vector asVector() const This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
inline constexpr TPoint3D_<T> cross(const TPoint3D_<T> &p) const
Cross product res = cross(this, p)
-
inline void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: “[0.02 1.04 -0.8]” )
See also
-
inline std::string asString() const
Public Static Functions
Public Static Attributes
-
static constexpr std::size_t static_size = 3