pub struct ScalingLens {
pub from_level: HierarchyLevel,
pub to_level: HierarchyLevel,
pub scale_factor: f64,
}Expand description
A scaling lens — maps between hierarchy levels (OCS §12.4).
The OCS spans 61 orders of magnitude. The scaling lens provides conversion factors between adjacent levels, enabling a “zoom” operation that preserves physical relationships.
Fields§
§from_level: HierarchyLevelSource hierarchy level
to_level: HierarchyLevelTarget hierarchy level
scale_factor: f64Linear scale factor (from → to)
Implementations§
Source§impl ScalingLens
impl ScalingLens
Sourcepub fn between(from: HierarchyLevel, to: HierarchyLevel) -> Self
pub fn between(from: HierarchyLevel, to: HierarchyLevel) -> Self
Create a scaling lens between two hierarchy levels (OCS §12.4).
Sourcepub fn transform_length(&self, length: f64) -> f64
pub fn transform_length(&self, length: f64) -> f64
Transform a length from the source level to the target level.
Sourcepub fn inverse_length(&self, length: f64) -> f64
pub fn inverse_length(&self, length: f64) -> f64
Transform a length back from target to source.
Trait Implementations§
Source§impl Clone for ScalingLens
impl Clone for ScalingLens
impl Copy for ScalingLens
Source§impl Debug for ScalingLens
impl Debug for ScalingLens
Source§impl PartialEq for ScalingLens
impl PartialEq for ScalingLens
impl StructuralPartialEq for ScalingLens
Auto Trait Implementations§
impl Freeze for ScalingLens
impl RefUnwindSafe for ScalingLens
impl Send for ScalingLens
impl Sync for ScalingLens
impl Unpin for ScalingLens
impl UnsafeUnpin for ScalingLens
impl UnwindSafe for ScalingLens
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