pub struct EuclideanSpace { /* private fields */ }Expand description
A 3-dimensional spatial context represented in standard Euclidean coordinates (x, y, z).
This struct is used as the default implementation of a purely spatial context in the DeepCausality framework. It supports coordinate access and distance measurement based on Euclidean geometry.
§Fields
id: A unique identifier for this spatial entityx: X-coordinate in metersy: Y-coordinate in metersz: Z-coordinate in meters
§Coordinate Index Mapping
When used with the Coordinate trait, the following index mapping applies:
0 => x1 => y2 => z
§Examples
use deep_causality::*;
let space_a = EuclideanSpace::new(1, 1.0, 2.0, 3.0);
let space_b = EuclideanSpace::new(2, 4.0, 6.0, 3.0);
assert_eq!(space_a.dimension(), 3);
assert_eq!(space_a.coordinate(1).unwrap(), &2.0);
assert_eq!(space_a.distance(&space_b), 5.0);Implementations§
Trait Implementations§
Source§impl Adjustable<f64> for EuclideanSpace
impl Adjustable<f64> for EuclideanSpace
Source§fn update<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>(
&mut self,
array_grid: &ArrayGrid<f64, WIDTH, HEIGHT, DEPTH, TIME>,
) -> Result<(), UpdateError>
fn update<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>( &mut self, array_grid: &ArrayGrid<f64, WIDTH, HEIGHT, DEPTH, TIME>, ) -> Result<(), UpdateError>
The default implementation does nothing to keep update optional.
Override this method to implement a node update when needed.
For a sample implementation, see src/types/context_types/node_types_adjustable
Source§fn adjust<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>(
&mut self,
array_grid: &ArrayGrid<f64, WIDTH, HEIGHT, DEPTH, TIME>,
) -> Result<(), AdjustmentError>
fn adjust<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>( &mut self, array_grid: &ArrayGrid<f64, WIDTH, HEIGHT, DEPTH, TIME>, ) -> Result<(), AdjustmentError>
The default implementation does nothing to keep adjustment optional.
Override this method to implement a node adjustment when needed.
Depending on the type of node adjustment, select a 1, 2,3, or 4 dimensional array grid
that contains the transformation data to apply to the node.
For a sample implementation, see src/types/context_types/node_types_adjustable
Source§impl Clone for EuclideanSpace
impl Clone for EuclideanSpace
Source§fn clone(&self) -> EuclideanSpace
fn clone(&self) -> EuclideanSpace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Coordinate<f64> for EuclideanSpace
impl Coordinate<f64> for EuclideanSpace
Source§impl Debug for EuclideanSpace
impl Debug for EuclideanSpace
Source§impl Display for EuclideanSpace
impl Display for EuclideanSpace
Source§impl Identifiable for EuclideanSpace
impl Identifiable for EuclideanSpace
Source§impl Metric<f64> for EuclideanSpace
impl Metric<f64> for EuclideanSpace
Source§impl PartialEq for EuclideanSpace
impl PartialEq for EuclideanSpace
impl Spatial<f64> for EuclideanSpace
impl StructuralPartialEq for EuclideanSpace
Auto Trait Implementations§
impl Freeze for EuclideanSpace
impl RefUnwindSafe for EuclideanSpace
impl Send for EuclideanSpace
impl Sync for EuclideanSpace
impl Unpin for EuclideanSpace
impl UnwindSafe for EuclideanSpace
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