Skip to main content

LocalFrame

Struct LocalFrame 

Source
pub struct LocalFrame<S> { /* private fields */ }
Expand description

Defines a local Cartesian coordinate frame with two axes forming a horizontal tangent plane to the reference surface (ellipsoid or sphere) at a specified tangent point. Assuming several calculations are needed in a limited area, position calculations can be performed relative to this system to get approximate horizontal and vertical components

Implementations§

Source§

impl<S> LocalFrame<S>
where S: Surface,

Source

pub fn enu(origin: GeodeticPosition, surface: S) -> Self

East-North-Up (local level) frame. This frame is useful for many targeting and tracking applications.

  • Orientation: The x-axis points towards east, the y-axis points towards north (both are horizontal), and the z-axis is pointing up.

See also NED

Source

pub fn ned(origin: GeodeticPosition, surface: S) -> Self

North-East-Down (local level) frame. In an airplane, most objects of interest are below the aircraft, so it is sensible to define down as a positive number.

  • The origin is directly beneath or above the vehicle (B), at Earth’s surface.
  • Orientation: The x-axis points towards north, the y-axis points towards east (both are horizontal), and the z-axis is pointing down.

Note: When moving relative to the Earth, the frame rotates about its z-axis to allow the x-axis to always point towards north. When getting close to the poles this rotation rate will increase, being infinite at the poles. The poles are thus singularities and the direction of the x- and y-axes are not defined here. Hence, this coordinate frame is not suitable for general calculations.

See also: ENU

Source

pub fn body( yaw: Angle, pitch: Angle, roll: Angle, origin: GeodeticPosition, surface: S, ) -> Self

Body frame (typically of a vehicle). This frame is fixed to the vehicle.

-The origin is in the vehicle’s reference point.

  • Orientation: The x-axis points forward, the y-axis to the right (starboard) and the z-axis in the vehicle’s down direction.
Source

pub fn local_level( wander_azimuth: Angle, origin: GeodeticPosition, surface: S, ) -> Self

Local level, Wander azimuth frame.

  • The origin is directly beneath or above the vehicle (B), at Earth’s surface.
  • Orientation: The z-axis is pointing down. Initially, the x-axis points towards north, and the y-axis points towards east, but as the vehicle moves they are not rotating about the z-axis (their angular velocity relative to the Earth has zero component along the z-axis). (Note: Any initial horizontal direction of the x- and y-axes is valid for L, but if the initial position is outside the poles, north and east are usually chosen for convenience.)

Notes: The L-frame is equal to the N-frame except for the rotation about the z-axis, which is always zero for this frame (relative to Earth). Hence, at a given time, the only difference between the frames is an angle between the x-axis of L and the north direction; this angle is called the wander azimuth angle. The L-frame is well suited for general calculations, as it is non-singular.

Source

pub fn geodetic_to_local_position(&self, p: GeodeticPosition) -> LocalPosition

Converts the given GeodeticPosition into a LocalPosition: the exact vector between this frame origin and the given position. The resulting LocalPosition orientation is the one of this frame.

Source

pub fn local_to_geodetic_position(&self, p: LocalPosition) -> GeodeticPosition

Converts the given LocalPosition into a GeodeticPosition: the geodetic position of an object which is located at a bearing and distance from this frame origin. The given LocalPosition is re-oriented to match the orientation of this frame if required.

Trait Implementations§

Source§

impl<S: Clone> Clone for LocalFrame<S>

Source§

fn clone(&self) -> LocalFrame<S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug> Debug for LocalFrame<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Default> Default for LocalFrame<S>

Source§

fn default() -> LocalFrame<S>

Returns the “default value” for a type. Read more
Source§

impl<S: PartialEq> PartialEq for LocalFrame<S>

Source§

fn eq(&self, other: &LocalFrame<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: Copy> Copy for LocalFrame<S>

Source§

impl<S> StructuralPartialEq for LocalFrame<S>

Auto Trait Implementations§

§

impl<S> Freeze for LocalFrame<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for LocalFrame<S>
where S: RefUnwindSafe,

§

impl<S> Send for LocalFrame<S>
where S: Send,

§

impl<S> Sync for LocalFrame<S>
where S: Sync,

§

impl<S> Unpin for LocalFrame<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for LocalFrame<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for LocalFrame<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.