pub struct SamplingPlane { /* private fields */ }Expand description
A finite rectangular sampling plane embedded in three-dimensional space.
origin is the corner before the first cell. Columns advance along u and
rows advance along v. A cell at (row, column) is sampled at its centre:
origin + (column + 1/2) * extent_u / columns * u
+ (row + 1/2) * extent_v / rows * v.
Construction validates the orthonormal frame, dimensions, derived cell
sizes, and rows * columns before any caller needs to allocate grid
storage.
Implementations§
Source§impl SamplingPlane
impl SamplingPlane
Sourcepub fn new(
origin: Point3M,
u_axis: UnitVector3,
v_axis: UnitVector3,
extent_u: PositiveMetres,
extent_v: PositiveMetres,
rows: usize,
columns: usize,
) -> Result<Self, InterferenceError>
pub fn new( origin: Point3M, u_axis: UnitVector3, v_axis: UnitVector3, extent_u: PositiveMetres, extent_v: PositiveMetres, rows: usize, columns: usize, ) -> Result<Self, InterferenceError>
Constructs a checked finite sampling plane.
Sourcepub fn u_axis(self) -> UnitVector3
pub fn u_axis(self) -> UnitVector3
Returns the direction in which columns advance.
Sourcepub fn v_axis(self) -> UnitVector3
pub fn v_axis(self) -> UnitVector3
Returns the direction in which rows advance.
Sourcepub fn normal(self) -> UnitVector3
pub fn normal(self) -> UnitVector3
Returns the right-handed unit normal u cross v.
Sourcepub fn extent_u(self) -> PositiveMetres
pub fn extent_u(self) -> PositiveMetres
Returns the physical u extent.
Sourcepub fn extent_v(self) -> PositiveMetres
pub fn extent_v(self) -> PositiveMetres
Returns the physical v extent.
Sourcepub fn cell_count(self) -> usize
pub fn cell_count(self) -> usize
Returns the checked product rows * columns.
Sourcepub fn cell_size_u_m(self) -> f64
pub fn cell_size_u_m(self) -> f64
Returns the centre-to-centre spacing along u in metres.
Sourcepub fn cell_size_v_m(self) -> f64
pub fn cell_size_v_m(self) -> f64
Returns the centre-to-centre spacing along v in metres.
Trait Implementations§
Source§impl Clone for SamplingPlane
impl Clone for SamplingPlane
Source§fn clone(&self) -> SamplingPlane
fn clone(&self) -> SamplingPlane
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more