pub trait SupportMapping<V> {
// Required method
fn support_mapping(&self, n: &V) -> V;
}Expand description
Find the point on a shape that is the furthest in a given direction.
§Example
use hoomd_geometry::{SupportMapping, shape::Hypercuboid};
let cuboid = Hypercuboid {
edge_lengths: [3.0.try_into()?, 2.0.try_into()?],
};
let upper_right = cuboid.support_mapping(&[1.0, 1.0].into());
let lower_right = cuboid.support_mapping(&[1.0, -1.0].into());
assert_eq!(upper_right, [1.5, 1.0].into());
assert_eq!(lower_right, [1.5, -1.0].into());Required Methods§
Sourcefn support_mapping(&self, n: &V) -> V
fn support_mapping(&self, n: &V) -> V
Return the furthest extent of a shape in the direction of n.