pub struct Coor4D(pub [f64; 4]);
Expand description
Generic 4D coordinate tuple, with no fixed interpretation of the elements
Tuple Fields§
§0: [f64; 4]
Implementations§
source§impl Coor4D
impl Coor4D
Constructors
sourcepub fn geo(latitude: f64, longitude: f64, height: f64, time: f64) -> Coor4D
pub fn geo(latitude: f64, longitude: f64, height: f64, time: f64) -> Coor4D
A Coor4D
from latitude/longitude/height/time, with the angular input in degrees
sourcepub fn arcsec(longitude: f64, latitude: f64, height: f64, time: f64) -> Coor4D
pub fn arcsec(longitude: f64, latitude: f64, height: f64, time: f64) -> Coor4D
A Coor4D
from longitude/latitude/height/time, with the angular input in seconds
of arc. Mostly for handling grid shift elements.
sourcepub fn gis(longitude: f64, latitude: f64, height: f64, time: f64) -> Coor4D
pub fn gis(longitude: f64, latitude: f64, height: f64, time: f64) -> Coor4D
A Coor4D
from longitude/latitude/height/time, with the angular input in degrees
sourcepub fn raw(first: f64, second: f64, third: f64, fourth: f64) -> Coor4D
pub fn raw(first: f64, second: f64, third: f64, fourth: f64) -> Coor4D
A Coor4D
from longitude/latitude/height/time, with the angular input in radians
sourcepub fn iso_dm(latitude: f64, longitude: f64, height: f64, time: f64) -> Coor4D
pub fn iso_dm(latitude: f64, longitude: f64, height: f64, time: f64) -> Coor4D
A Coor4D
from latitude/longitude/height/time, with
the angular input in the ISO-6709 DDDMM.mmmmm format
Trait Implementations§
source§impl CoordinateTuple for Coor4D
impl CoordinateTuple for Coor4D
source§fn nth_unchecked(&self, n: usize) -> f64
fn nth_unchecked(&self, n: usize) -> f64
Access the n’th (0-based) element of the CoordinateTuple.
May panic if n >= DIMENSION.
See also
nth()
.source§fn set_nth_unchecked(&mut self, n: usize, value: f64)
fn set_nth_unchecked(&mut self, n: usize, value: f64)
source§fn nth(&self, n: usize) -> f64
fn nth(&self, n: usize) -> f64
Access the n’th (0-based) element of the CoordinateTuple.
Returns NaN if
n >= DIMENSION
.
See also nth()
.source§fn y(&self) -> f64
fn y(&self) -> f64
Pragmatically named accessor for the second element of the CoordinateTuple.
source§fn t(&self) -> f64
fn t(&self) -> f64
Pragmatically named accessor for the fourth element of the CoordinateTuple.
source§fn xy(&self) -> (f64, f64)
fn xy(&self) -> (f64, f64)
A tuple containing the first two components of the CoordinateTuple.
source§fn xyz(&self) -> (f64, f64, f64)
fn xyz(&self) -> (f64, f64, f64)
A tuple containing the first three components of the CoordinateTuple.
source§fn xyzt(&self) -> (f64, f64, f64, f64)
fn xyzt(&self) -> (f64, f64, f64, f64)
A tuple containing the first four components of the CoordinateTuple.
source§fn xy_to_degrees(&self) -> (f64, f64)
fn xy_to_degrees(&self) -> (f64, f64)
A tuple containing the first two components of the CoordinateTuple
converted from radians to degrees
source§fn xyz_to_degrees(&self) -> (f64, f64, f64)
fn xyz_to_degrees(&self) -> (f64, f64, f64)
A tuple containing the first three components of the CoordinateTuple,
with the first two converted from radians to degrees.
source§fn xyzt_to_degrees(&self) -> (f64, f64, f64, f64)
fn xyzt_to_degrees(&self) -> (f64, f64, f64, f64)
A tuple containing the first four components of the CoordinateTuple,
with the first two converted from radians to degrees.
source§fn xy_to_arcsec(&self) -> (f64, f64)
fn xy_to_arcsec(&self) -> (f64, f64)
A tuple containing the first two components of the CoordinateTuple,
converted from radians to seconds-of-arc
source§fn xyz_to_arcsec(&self) -> (f64, f64, f64)
fn xyz_to_arcsec(&self) -> (f64, f64, f64)
A tuple containing the first three components of the CoordinateTuple,
with the first two converted to seconds-of-arc
source§fn xyzt_to_arcsec(&self) -> (f64, f64, f64, f64)
fn xyzt_to_arcsec(&self) -> (f64, f64, f64, f64)
A tuple containing the first four components of the CoordinateTuple,
with the first two converted to seconds-of-arc
source§fn xy_to_radians(&self) -> (f64, f64)
fn xy_to_radians(&self) -> (f64, f64)
A tuple containing the first two components of the CoordinateTuple,
converted from degrees to radians
source§fn xyz_to_radians(&self) -> (f64, f64, f64)
fn xyz_to_radians(&self) -> (f64, f64, f64)
A tuple containing the first three components of the CoordinateTuple,
with the first two converted from degrees to radians
source§fn xyzt_to_radians(&self) -> (f64, f64, f64, f64)
fn xyzt_to_radians(&self) -> (f64, f64, f64, f64)
A tuple containing the first four components of the CoordinateTuple,
with the first two converted from degrees to radians
source§fn set_nth(&mut self, n: usize, value: f64)
fn set_nth(&mut self, n: usize, value: f64)
Replace the n’th (0-based) element of the
CoordinateTuple
with value
.
If n >=
dim()
fill the coordinate with f64::NAN
.
See also set_nth_unchecked()
.source§fn set_xy(&mut self, x: f64, y: f64)
fn set_xy(&mut self, x: f64, y: f64)
Replace the two first elements of the
CoordinateTuple
with x
and y
.
If the dimension is less than 2, fill the coordinate with f64::NAN
.
See also set_nth_unchecked()
.source§fn set_xyz(&mut self, x: f64, y: f64, z: f64)
fn set_xyz(&mut self, x: f64, y: f64, z: f64)
Replace the three first elements of the
CoordinateTuple
with x
, y
and z
.
If the dimension is less than 3, fill the coordinate with f64::NAN
.source§fn set_xyzt(&mut self, x: f64, y: f64, z: f64, t: f64)
fn set_xyzt(&mut self, x: f64, y: f64, z: f64, t: f64)
Replace the four first elements of the
CoordinateTuple
with x
, y
z
and t
.
If the dimension is less than 4, fill the coordinate with f64::NAN
.source§fn hypot2(&self, other: &Self) -> f64where
Self: Sized,
fn hypot2(&self, other: &Self) -> f64where
Self: Sized,
Euclidean distance between two points in the 2D plane. Read more
source§fn hypot3(&self, other: &Self) -> f64where
Self: Sized,
fn hypot3(&self, other: &Self) -> f64where
Self: Sized,
Euclidean distance between two points in the 3D space. Read more
fn scale(&self, factor: f64) -> Self
fn dot(&self, other: Self) -> f64where
Self: Sized,
source§impl PartialEq for Coor4D
impl PartialEq for Coor4D
impl Copy for Coor4D
impl StructuralPartialEq for Coor4D
Auto Trait Implementations§
impl Freeze for Coor4D
impl RefUnwindSafe for Coor4D
impl Send for Coor4D
impl Sync for Coor4D
impl Unpin for Coor4D
impl UnwindSafe for Coor4D
Blanket Implementations§
source§impl<T> AngularUnits for Twhere
T: CoordinateTuple + Copy,
impl<T> AngularUnits for Twhere
T: CoordinateTuple + Copy,
source§fn to_degrees(&self) -> T
fn to_degrees(&self) -> T
Convert the first two elements of self
from radians to degrees
source§fn to_radians(&self) -> T
fn to_radians(&self) -> T
Convert the first two elements of self
from degrees to radians
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