pub struct NedSpace { /* private fields */ }Expand description
A local tangent-plane spatial context using the North-East-Down (NED) reference frame.
NedSpace represents a point in a locally linearized coordinate system centered at a reference
geodetic location (typically defined by a GPS fix). It is commonly used in aerospace,
robotics, and real-time navigation systems to express motion and sensor positions
relative to a local Earth-aligned frame.
This frame uses the following axis definitions:
- North (+N): tangential to the Earth’s surface, pointing toward the North Pole
- East (+E): tangential to the Earth’s surface, perpendicular to North, pointing eastward
- Down (+D): aligned with gravity, pointing toward the Earth’s center (positive downward)
This results in a right-handed coordinate system with the origin at a defined reference point, and the frame fixed to the Earth — making it suitable for integrating IMUs, magnetometers, and other aircraft-attached sensors.
§Fields
id: Unique numeric identifier for this NED spatial context (e.g., sensor ID)north: Position in meters along the northward axiseast: Position in meters along the eastward axisdown: Position in meters along the downward (gravity-aligned) axis
§Coordinate Index Mapping
When used with the Coordinate trait, the following index mapping applies:
0 => north1 => east2 => down
§Common Applications
- Aircraft position estimation relative to a flight segment origin
- Magnetometer placement in local frame for MagNav systems
- Inertial Navigation System (INS) drift correction
- Real-time sensor fusion in autonomous drones or ground vehicles
§Example
use deep_causality::*;
let n1 = NedSpace::new(1, 0.0, 0.0, 0.0); // Reference origin
let n2 = NedSpace::new(2, 100.0, 50.0, 10.0); // 100m North, 50m East, 10m below origin
println!("{}", n2);
assert_eq!(n2.dimension(), 3);
assert_eq!(n1.distance(&n2), (100.0_f64.powi(2) + 50.0_f64.powi(2) + 10.0_f64.powi(2)).sqrt());§Notes
- The “down” axis is positive in the direction of gravity. This is a key difference from ENU (East-North-Up) or typical 3D Cartesian conventions.
- This struct assumes flat-Earth approximation — for global modeling, use
GeoSpaceorEcefSpace.
Implementations§
Trait Implementations§
Source§impl Adjustable<f64> for NedSpace
impl Adjustable<f64> for NedSpace
Source§fn update<const W: usize, const H: usize, const D: usize, const C: usize>(
&mut self,
array_grid: &ArrayGrid<f64, W, H, D, C>,
) -> Result<(), UpdateError>
fn update<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<f64, W, H, D, C>, ) -> 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 W: usize, const H: usize, const D: usize, const C: usize>(
&mut self,
array_grid: &ArrayGrid<f64, W, H, D, C>,
) -> Result<(), AdjustmentError>
fn adjust<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<f64, W, H, D, C>, ) -> 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 Coordinate<f64> for NedSpace
impl Coordinate<f64> for NedSpace
impl Spatial<f64> for NedSpace
impl StructuralPartialEq for NedSpace
Auto Trait Implementations§
impl Freeze for NedSpace
impl RefUnwindSafe for NedSpace
impl Send for NedSpace
impl Sync for NedSpace
impl Unpin for NedSpace
impl UnwindSafe for NedSpace
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