Struct geodesy::Coor2D

source ·
pub struct Coor2D(pub [f64; 2]);
Expand description

Generic 2D Coordinate tuple, with no fixed interpretation of the elements

Tuple Fields§

§0: [f64; 2]

Implementations§

source§

impl Coor2D

Constructors

source

pub fn geo(latitude: f64, longitude: f64) -> Coor2D

A Coor2D from latitude/longitude/height/time, with the angular input in degrees, and height and time ignored.

source

pub fn arcsec(longitude: f64, latitude: f64) -> Coor2D

A Coor2D from longitude/latitude/height/time, with the angular input in seconds of arc. Mostly for handling grid shift elements.

source

pub fn gis(longitude: f64, latitude: f64) -> Coor2D

A Coor2D from longitude/latitude/height/time, with the angular input in degrees. and height and time ignored.

source

pub fn raw(first: f64, second: f64) -> Coor2D

A Coor2D from longitude/latitude/height/time, with the angular input in radians, and third and fourth arguments ignored.

source

pub fn iso_dm(latitude: f64, longitude: f64) -> Coor2D

A Coor2D from latitude/longitude/height/time, with the angular input in the ISO-6709 DDDMM.mmmmm format, and height and time ignored.

source

pub fn iso_dms(latitude: f64, longitude: f64) -> Coor2D

A Coor2D from latitude/longitude/height/time, with the angular input in the ISO-6709 DDDMMSS.sssss format, and height and time ignored.

source

pub fn nan() -> Coor2D

A Coor2D consisting of 2 NaNs

source

pub fn origin() -> Coor2D

A Coor2D consisting of 2 0s

source

pub fn ones() -> Coor2D

A Coor2D consisting of 2 1s

source

pub fn scale(&self, factor: f64) -> Coor2D

Arithmetic (also see the operator trait implementations add, sub, mul, div) Multiply by a scalar

source

pub fn dot(&self, other: Coor2D) -> f64

Scalar product

Trait Implementations§

source§

impl Clone for Coor2D

source§

fn clone(&self) -> Coor2D

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 CoordinateTuple for Coor2D

source§

fn dim(&self) -> usize

Native dimension of the coordinate tuple
source§

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)

Replace the n’th (0-based) element of the CoordinateTuple with value. May panic if n >= dim(). See also set_nth().
source§

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 x(&self) -> f64

Pragmatically named accessor for the first element of the CoordinateTuple.
source§

fn y(&self) -> f64

Pragmatically named accessor for the second element of the CoordinateTuple.
source§

fn z(&self) -> f64

Pragmatically named accessor for the third element of the CoordinateTuple.
source§

fn t(&self) -> f64

Pragmatically named accessor for the fourth element of the CoordinateTuple.
source§

fn xy(&self) -> (f64, f64)

A tuple containing the first two components of the CoordinateTuple.
source§

fn xyz(&self) -> (f64, f64, f64)

A tuple containing the first three components of the CoordinateTuple.
source§

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)

A tuple containing the first two components of the CoordinateTuple converted from radians to degrees
source§

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)

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)

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)

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)

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)

A tuple containing the first two components of the CoordinateTuple, converted from degrees to radians
source§

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)

A tuple containing the first four components of the CoordinateTuple, with the first two converted from degrees to radians
source§

fn fill(&mut self, value: f64)

Fill all elements of self with value
source§

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)

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)

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)

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 update(&mut self, value: &[f64])

Replace the N first (up to dim()) elements of self with the elements of value
source§

fn hypot2(&self, other: &Self) -> f64
where Self: Sized,

Euclidean distance between two points in the 2D plane. Read more
source§

fn hypot3(&self, other: &Self) -> f64
where Self: Sized,

Euclidean distance between two points in the 3D space. Read more
source§

fn scale(&self, factor: f64) -> Self
where Self: Sized + Copy,

source§

fn dot(&self, other: Self) -> f64
where Self: Sized,

source§

impl Debug for Coor2D

source§

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

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

impl Default for Coor2D

source§

fn default() -> Coor2D

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

impl Index<usize> for Coor2D

§

type Output = f64

The returned type after indexing.
source§

fn index(&self, i: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<usize> for Coor2D

source§

fn index_mut(&mut self, i: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl PartialEq for Coor2D

source§

fn eq(&self, other: &Coor2D) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Coor2D

source§

impl StructuralPartialEq for Coor2D

Auto Trait Implementations§

§

impl Freeze for Coor2D

§

impl RefUnwindSafe for Coor2D

§

impl Send for Coor2D

§

impl Sync for Coor2D

§

impl Unpin for Coor2D

§

impl UnwindSafe for Coor2D

Blanket Implementations§

source§

impl<T> AngularUnits for T
where T: CoordinateTuple + Copy,

source§

fn to_degrees(&self) -> T

Convert the first two elements of self from radians to degrees

source§

fn to_arcsec(&self) -> T

Convert the first two elements of self from radians to degrees

source§

fn to_radians(&self) -> T

Convert the first two elements of self from degrees to radians

source§

fn to_geo(&self) -> T

Convert-and-swap the first two elements of self from radians to degrees

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> CoordinateMetadata for T
where T: ?Sized,

source§

fn crs_id(&self) -> Option<MdIdentifier>

source§

fn crs(&self) -> Option<Crs>

source§

fn coordinate_epoch(&self) -> Option<DataEpoch>

source§

fn is_valid(&self) -> bool

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,

§

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>,

§

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>,

§

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.