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,
impl<S> LocalFrame<S>where
S: Surface,
Sourcepub fn enu(origin: GeodeticPosition, surface: S) -> Self
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
Sourcepub fn ned(origin: GeodeticPosition, surface: S) -> Self
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
Sourcepub fn body(
yaw: Angle,
pitch: Angle,
roll: Angle,
origin: GeodeticPosition,
surface: S,
) -> Self
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.
Sourcepub fn local_level(
wander_azimuth: Angle,
origin: GeodeticPosition,
surface: S,
) -> Self
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.
Sourcepub fn geodetic_to_local_position(&self, p: GeodeticPosition) -> LocalPosition
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.
Sourcepub fn local_to_geodetic_position(&self, p: LocalPosition) -> GeodeticPosition
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>
impl<S: Clone> Clone for LocalFrame<S>
Source§fn clone(&self) -> LocalFrame<S>
fn clone(&self) -> LocalFrame<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more