Struct Lle

Source
pub struct Lle<CoordinateSystem, AngularMeasure = Degrees>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy, CoordinateSystem: CoordinateSystem<AngularMeasure>,
{ pub latitude: AngularMeasure, pub longitude: AngularMeasure, pub elevation: Meters, /* private fields */ }
Expand description

Lle or Latitude, Longitude, Elevation, is a location somewhere around Earth, in refernce to some CoordinateSystem’s ellipsoid.

Relatedly, this means that the elevation is the number of Meters above the CoordinateSystem’s ellipsoid, not the altitude above or below the true surface of the Earth.

The provided CoordinateSystem should be the CoordinateSystem that the Latitude, Longitude and Elevation are in refernce to, usually Wgs84. If you don’t know otherwise, it’s a safe to assume that you want to use Lle<Wgs84>. If you know otherwise, you may not have needed this warning.

Additionally, the latitude and longitude fields can be specified in either Degrees or Radians. Unless you know otherwise, you likely want to work with Degrees, and is the default if nothing is specified.

Fields§

§latitude: AngularMeasure

Latitude, in degrees, for some geodetic coordinate system.

§longitude: AngularMeasure

Longitude, in degrees, for some geodetic coordinate system.

§elevation: Meters

Elevation above the ellipsoid for some geodetic coordinate system. This is not the same as altitude above the surface.

Implementations§

Source§

impl<CoordinateSystem, AngularMeasure> Lle<CoordinateSystem, AngularMeasure>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy, CoordinateSystem: CoordinateSystem<AngularMeasure>,

Source

pub const fn new( latitude: AngularMeasure, longitude: AngularMeasure, elevation: Meters, ) -> Lle<CoordinateSystem, AngularMeasure>

Create a new Lle (latitude, longitude, elevation) from parts.

Examples found in repository?
examples/latlon.rs (lines 4-8)
3fn main() {
4    let tea_party = Lle::<Wgs84>::new(
5        Degrees::new(42.352211),
6        Degrees::new(-71.051315),
7        Meters::new(0.0),
8    );
9    let georges_island = Lle::<Wgs84>::new(
10        Degrees::new(42.320239),
11        Degrees::new(-70.929482),
12        Meters::new(100.0),
13    );
14
15    let look: Aer<Degrees> = tea_party.aer_to(&georges_island);
16    println!(
17        "Azimuth: {} deg, Elevation: {} deg, Range: {} meters",
18        look.azimuth.as_float(),
19        look.elevation.as_float(),
20        look.range.as_float()
21    );
22}
More examples
Hide additional examples
examples/converto.rs (lines 4-8)
3fn main() {
4    let tea_party = Lle::<Wgs84>::new(
5        Degrees::new(42.352211),
6        Degrees::new(-71.051315),
7        Meters::new(0.0),
8    );
9    let somewhere =
10        Lle::<Wgs72, Radians>::new(Radians::new(0.3), Radians::new(2.2), Meters::new(10.0));
11
12    // Our goal:
13    //
14    // Take a Wgs84 Lat/Lon in Degrees,and a Wgs72 Lat/Lon in Radians, and
15    // compute the look angle in the local tangent plane in Degrees.
16
17    let look: Aer<Degrees> = tea_party.aer_to(&somewhere.translate());
18
19    println!(
20        "A/E/R: {:?} {:?} {:?}",
21        look.azimuth, look.elevation, look.range
22    );
23}
Source

pub fn enu_to(&self, other: &Lle<CoordinateSystem, AngularMeasure>) -> Enu

Compute the East-North-Up of some provided point (other) given some refernce location self.

Source

pub fn aer_to<AerAngularMeasure>( &self, other: &Lle<CoordinateSystem, AngularMeasure>, ) -> Aer<AerAngularMeasure>
where Aer<AerAngularMeasure>: From<Enu>,

Compute the Az-El-Range of some provided point (other) given some reference location self.

Examples found in repository?
examples/latlon.rs (line 15)
3fn main() {
4    let tea_party = Lle::<Wgs84>::new(
5        Degrees::new(42.352211),
6        Degrees::new(-71.051315),
7        Meters::new(0.0),
8    );
9    let georges_island = Lle::<Wgs84>::new(
10        Degrees::new(42.320239),
11        Degrees::new(-70.929482),
12        Meters::new(100.0),
13    );
14
15    let look: Aer<Degrees> = tea_party.aer_to(&georges_island);
16    println!(
17        "Azimuth: {} deg, Elevation: {} deg, Range: {} meters",
18        look.azimuth.as_float(),
19        look.elevation.as_float(),
20        look.range.as_float()
21    );
22}
More examples
Hide additional examples
examples/converto.rs (line 17)
3fn main() {
4    let tea_party = Lle::<Wgs84>::new(
5        Degrees::new(42.352211),
6        Degrees::new(-71.051315),
7        Meters::new(0.0),
8    );
9    let somewhere =
10        Lle::<Wgs72, Radians>::new(Radians::new(0.3), Radians::new(2.2), Meters::new(10.0));
11
12    // Our goal:
13    //
14    // Take a Wgs84 Lat/Lon in Degrees,and a Wgs72 Lat/Lon in Radians, and
15    // compute the look angle in the local tangent plane in Degrees.
16
17    let look: Aer<Degrees> = tea_party.aer_to(&somewhere.translate());
18
19    println!(
20        "A/E/R: {:?} {:?} {:?}",
21        look.azimuth, look.elevation, look.range
22    );
23}
Source§

impl<FromCoordinateSystem, FromAngularMeasure> Lle<FromCoordinateSystem, FromAngularMeasure>
where Radians: From<FromAngularMeasure> + Copy, FromAngularMeasure: From<Radians> + Copy, FromCoordinateSystem: CoordinateSystem<FromAngularMeasure>, Self: Copy,

Source

pub fn translate<ToCoordinateSystem, ToAngularMeasure>( &self, ) -> Lle<ToCoordinateSystem, ToAngularMeasure>
where Radians: From<ToAngularMeasure> + Copy, ToAngularMeasure: From<Radians> + Copy, ToCoordinateSystem: CoordinateSystem<ToAngularMeasure>,

Translate from one CoordinateSystem to another CoordinateSystem.

This isn’t a From trait since Rust doesn’t have the ability to implement conversions between the same type. In the future when Rust can handle specialization or negating a blanket generic implementation (such as where FromCoordinateSystem != ToCoordinateSystem), this method will be deprecated for a plain .into().

It's not clear to me that, as things are implemented right now, that Xyz's (0.0, 0.0, 0.0) is the same exact point in space for all the CoordinateSystems, although this library will assume they are. As such, I'm not confident these conversions are implemented properly, and must not be relied upon for anything approaching important.
Examples found in repository?
examples/converto.rs (line 17)
3fn main() {
4    let tea_party = Lle::<Wgs84>::new(
5        Degrees::new(42.352211),
6        Degrees::new(-71.051315),
7        Meters::new(0.0),
8    );
9    let somewhere =
10        Lle::<Wgs72, Radians>::new(Radians::new(0.3), Radians::new(2.2), Meters::new(10.0));
11
12    // Our goal:
13    //
14    // Take a Wgs84 Lat/Lon in Degrees,and a Wgs72 Lat/Lon in Radians, and
15    // compute the look angle in the local tangent plane in Degrees.
16
17    let look: Aer<Degrees> = tea_party.aer_to(&somewhere.translate());
18
19    println!(
20        "A/E/R: {:?} {:?} {:?}",
21        look.azimuth, look.elevation, look.range
22    );
23}

Trait Implementations§

Source§

impl<CoordinateSystem, AngularMeasure> Clone for Lle<CoordinateSystem, AngularMeasure>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy + Clone, CoordinateSystem: CoordinateSystem<AngularMeasure> + Clone,

Source§

fn clone(&self) -> Lle<CoordinateSystem, AngularMeasure>

Returns a copy 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<CoordinateSystem, AngularMeasure> Debug for Lle<CoordinateSystem, AngularMeasure>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy + Debug, CoordinateSystem: CoordinateSystem<AngularMeasure> + Debug,

Source§

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

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

impl<CoordinateSystem, AngularMeasure> From<Lle<CoordinateSystem, AngularMeasure>> for Xyz
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy, CoordinateSystem: CoordinateSystem<AngularMeasure>,

Source§

fn from(lle: Lle<CoordinateSystem, AngularMeasure>) -> Self

Convert some Lle into an Xyz coordinate using Lle’s CoordinateSystem.

Source§

impl<CoordinateSystem, AngularMeasure> From<Xyz> for Lle<CoordinateSystem, AngularMeasure>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy, CoordinateSystem: CoordinateSystem<AngularMeasure>,

Source§

fn from(xyz: Xyz) -> Self

Convert some Xyz into an Lle coordinate using Lle’s CoordinateSystem.

Source§

impl<CoordinateSystem, AngularMeasure> PartialEq for Lle<CoordinateSystem, AngularMeasure>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy + PartialEq, CoordinateSystem: CoordinateSystem<AngularMeasure> + PartialEq,

Source§

fn eq(&self, other: &Lle<CoordinateSystem, AngularMeasure>) -> 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<CoordinateSystem, AngularMeasure> Copy for Lle<CoordinateSystem, AngularMeasure>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy + Copy, CoordinateSystem: CoordinateSystem<AngularMeasure> + Copy,

Source§

impl<CoordinateSystem, AngularMeasure> StructuralPartialEq for Lle<CoordinateSystem, AngularMeasure>
where Radians: From<AngularMeasure> + Copy, AngularMeasure: From<Radians> + Copy, CoordinateSystem: CoordinateSystem<AngularMeasure>,

Auto Trait Implementations§

§

impl<CoordinateSystem, AngularMeasure> Freeze for Lle<CoordinateSystem, AngularMeasure>
where Radians: Sized, AngularMeasure: Freeze,

§

impl<CoordinateSystem, AngularMeasure> RefUnwindSafe for Lle<CoordinateSystem, AngularMeasure>
where Radians: Sized, AngularMeasure: RefUnwindSafe, CoordinateSystem: RefUnwindSafe,

§

impl<CoordinateSystem, AngularMeasure> Send for Lle<CoordinateSystem, AngularMeasure>
where Radians: Sized, AngularMeasure: Send, CoordinateSystem: Send,

§

impl<CoordinateSystem, AngularMeasure> Sync for Lle<CoordinateSystem, AngularMeasure>
where Radians: Sized, AngularMeasure: Sync, CoordinateSystem: Sync,

§

impl<CoordinateSystem, AngularMeasure> Unpin for Lle<CoordinateSystem, AngularMeasure>
where Radians: Sized, AngularMeasure: Unpin, CoordinateSystem: Unpin,

§

impl<CoordinateSystem, AngularMeasure> UnwindSafe for Lle<CoordinateSystem, AngularMeasure>
where Radians: Sized, AngularMeasure: UnwindSafe, CoordinateSystem: 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.