Struct fenris_geometry::HalfSpace
source · pub struct HalfSpace<T: Scalar, D: DimName = U3>where
DefaultAllocator: Allocator<T, D>,{ /* private fields */ }
Expand description
A $D$-dimensional half space.
A half space is defined by a point $\vec x$ and a normalized unit vector (normal) $\vec n$. The points belonging to the half space is then given by the points $\vec y$ that satisfy
$$
(\vec y - \vec x) \cdot \vec n \leq 0.
$$
Implementations§
source§impl<T, D> HalfSpace<T, D>where
T: Real,
D: DimName,
DefaultAllocator: Allocator<T, D>,
impl<T, D> HalfSpace<T, D>where
T: Real,
D: DimName,
DefaultAllocator: Allocator<T, D>,
pub fn signed_distance_to_point(&self, point: &OPoint<T, D>) -> T
pub fn contains_point(&self, point: &OPoint<T, D>) -> bool
pub fn from_point_and_normal(
point: OPoint<T, D>,
normal: Unit<OVector<T, D>>
) -> Self
pub fn point(&self) -> &OPoint<T, D>
sourcepub fn normal(&self) -> &OVector<T, D>
pub fn normal(&self) -> &OVector<T, D>
Returns the outwards-facing normal vector for the plane.
This vector is normalized.
pub fn complement(&self) -> Self
Trait Implementations§
source§impl<T: Clone + Scalar, D: Clone + DimName> Clone for HalfSpace<T, D>where
DefaultAllocator: Allocator<T, D>,
impl<T: Clone + Scalar, D: Clone + DimName> Clone for HalfSpace<T, D>where
DefaultAllocator: Allocator<T, D>,
source§impl<T: Debug + Scalar, D: Debug + DimName> Debug for HalfSpace<T, D>where
DefaultAllocator: Allocator<T, D>,
impl<T: Debug + Scalar, D: Debug + DimName> Debug for HalfSpace<T, D>where
DefaultAllocator: Allocator<T, D>,
source§impl<T: PartialEq + Scalar, D: PartialEq + DimName> PartialEq<HalfSpace<T, D>> for HalfSpace<T, D>where
DefaultAllocator: Allocator<T, D>,
impl<T: PartialEq + Scalar, D: PartialEq + DimName> PartialEq<HalfSpace<T, D>> for HalfSpace<T, D>where
DefaultAllocator: Allocator<T, D>,
impl<T: Scalar, D: DimName> StructuralPartialEq for HalfSpace<T, D>where
DefaultAllocator: Allocator<T, D>,
Auto Trait Implementations§
impl<T, D = Const<3>> !RefUnwindSafe for HalfSpace<T, D>
impl<T, D = Const<3>> !Send for HalfSpace<T, D>
impl<T, D = Const<3>> !Sync for HalfSpace<T, D>
impl<T, D = Const<3>> !Unpin for HalfSpace<T, D>
impl<T, D = Const<3>> !UnwindSafe for HalfSpace<T, D>
Blanket Implementations§
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.