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: AngularMeasureLatitude, in degrees, for some geodetic coordinate system.
longitude: AngularMeasureLongitude, in degrees, for some geodetic coordinate system.
elevation: MetersElevation 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>
impl<CoordinateSystem, AngularMeasure> Lle<CoordinateSystem, AngularMeasure>
Sourcepub const fn new(
latitude: AngularMeasure,
longitude: AngularMeasure,
elevation: Meters,
) -> Lle<CoordinateSystem, AngularMeasure>
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?
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
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}Sourcepub fn enu_to(&self, other: &Lle<CoordinateSystem, AngularMeasure>) -> Enu
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.
Sourcepub fn aer_to<AerAngularMeasure>(
&self,
other: &Lle<CoordinateSystem, AngularMeasure>,
) -> Aer<AerAngularMeasure>
pub fn aer_to<AerAngularMeasure>( &self, other: &Lle<CoordinateSystem, AngularMeasure>, ) -> Aer<AerAngularMeasure>
Compute the Az-El-Range of some provided point (other) given
some reference location self.
Examples found in repository?
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
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>
impl<FromCoordinateSystem, FromAngularMeasure> Lle<FromCoordinateSystem, FromAngularMeasure>
Sourcepub fn translate<ToCoordinateSystem, ToAngularMeasure>(
&self,
) -> Lle<ToCoordinateSystem, ToAngularMeasure>
pub fn translate<ToCoordinateSystem, ToAngularMeasure>( &self, ) -> Lle<ToCoordinateSystem, 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().
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?
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}