pub struct IntersectionVolume { /* private fields */ }Expand description
The volume two closed bodies share, with each body’s own volume.
Every value is a certified VolumeInterval. The shared volume cannot
exceed either body’s, so bounds claiming it must are refused.
Implementations§
Source§impl IntersectionVolume
impl IntersectionVolume
Sourcepub fn try_new(
shared: VolumeInterval,
subject: VolumeInterval,
counterpart: VolumeInterval,
) -> Result<Self, ProximityError>
pub fn try_new( shared: VolumeInterval, subject: VolumeInterval, counterpart: VolumeInterval, ) -> Result<Self, ProximityError>
The shared volume and the volumes of the request’s subject and counterpart.
The volume both bodies occupy.
Sourcepub fn subject(&self) -> VolumeInterval
pub fn subject(&self) -> VolumeInterval
The subject’s own volume.
Sourcepub fn counterpart(&self) -> VolumeInterval
pub fn counterpart(&self) -> VolumeInterval
The counterpart’s own volume.
Sourcepub fn smaller(&self) -> VolumeInterval
pub fn smaller(&self) -> VolumeInterval
The volume of the smaller body: the lesser of the two volumes.
Sourcepub fn ratio_of_smaller(&self) -> (f64, f64)
pub fn ratio_of_smaller(&self) -> (f64, f64)
(lower, upper) bounds on the shared volume’s share of the smaller
body, between zero and one: one when one body lies wholly in the
other. Rounded outward, so the true ratio always lies inside.
Trait Implementations§
Source§impl Clone for IntersectionVolume
impl Clone for IntersectionVolume
impl Copy for IntersectionVolume
Source§impl Debug for IntersectionVolume
impl Debug for IntersectionVolume
Source§impl PartialEq for IntersectionVolume
impl PartialEq for IntersectionVolume
impl StructuralPartialEq for IntersectionVolume
Auto Trait Implementations§
impl Freeze for IntersectionVolume
impl RefUnwindSafe for IntersectionVolume
impl Send for IntersectionVolume
impl Sync for IntersectionVolume
impl Unpin for IntersectionVolume
impl UnsafeUnpin for IntersectionVolume
impl UnwindSafe for IntersectionVolume
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more