template<typename T>
werkzeugkiste::geometry::Plane_ class

Represents a plane in 3d Euclidean space.

Public types

using vec_type = Vec<T, 3>

Constructors, destructors, conversion operators

Plane_() defaulted
Constructs an invalid plane.
Plane_(const vec_type& normal, T offset)
Constructs a plane from its Hessian form.
Plane_(const vec_type& p, const vec_type& q, const vec_type& r)
Constructs a plane from 3 points. If the points are collinear, the plane will be invalid.

Public functions

auto IsValid() const -> bool
Returns true if the plane has a valid normal vector.
auto Normal() const -> vec_type
Returns the plane's normal vector.
auto Offset() const -> T
Returns the plane's offset, i.e. the distance from the plane to the coordinate system origin, measured along the plane's normal. Put differently, this is the minimum distance between the plane and the origin.
auto DistancePointToPlane(const vec_type& pt) const -> T
Returns the distance from the given point to the plane.
auto IsPointInFrontOfPlane(const vec_type& pt) const -> bool
Returns true if the given point is in front of the plane, i.e. the side where the plane's normal points to.
auto IsPointOnPlane(const vec_type& pt) const -> bool
Returns true if the given point lies exactly on the plane.
auto AngleRad(const Plane_& other) const -> double
Returns the dihedral angle, i.e. the angle between the two planes, in radians. The angle will be between 0 and Pi.
auto AngleDeg(const Plane_& other) const -> double
Returns the dihedral angle, i.e. the angle between the two planes, in degrees. The angle will be between 0 and 180.
auto AngleRad(const Line3d_<T>& line) const -> double
Returns the angle between this plane and the line in radians. The angle will be between -Pi/2 and Pi/2.
auto AngleDeg(const Line3d_<T>& line) const -> double
Returns the angle between this plane and the line in degrees. The angle will be between -90 and +90.
auto XYZIntercepts() const -> vec_type
Returns the plane's x-, y- and z-intercepts.

Friends

auto operator<<(std::ostream& stream, const Plane_& plane) -> std::ostream&
Overloaded output stream operator.