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
impl Coor2D
Constructors
sourcepub fn geo(latitude: f64, longitude: f64) -> Coor2D
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.
sourcepub fn arcsec(longitude: f64, latitude: f64) -> Coor2D
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.
sourcepub fn gis(longitude: f64, latitude: f64) -> Coor2D
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.
sourcepub fn raw(first: f64, second: f64) -> Coor2D
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.
sourcepub fn iso_dm(latitude: f64, longitude: f64) -> Coor2D
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.
sourcepub fn iso_dms(latitude: f64, longitude: f64) -> Coor2D
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.
Trait Implementations§
source§impl CoordinateTuple for Coor2D
impl CoordinateTuple for Coor2D
source§fn nth_unchecked(&self, n: usize) -> f64
fn nth_unchecked(&self, n: usize) -> f64
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
n >= DIMENSION
.
See also nth()
.source§fn y(&self) -> f64
fn y(&self) -> f64
source§fn t(&self) -> f64
fn t(&self) -> f64
source§fn xy(&self) -> (f64, f64)
fn xy(&self) -> (f64, f64)
source§fn xyz(&self) -> (f64, f64, f64)
fn xyz(&self) -> (f64, f64, f64)
source§fn xyzt(&self) -> (f64, f64, f64, f64)
fn xyzt(&self) -> (f64, f64, f64, f64)
source§fn xy_to_degrees(&self) -> (f64, f64)
fn xy_to_degrees(&self) -> (f64, f64)
source§fn xyz_to_degrees(&self) -> (f64, f64, f64)
fn xyz_to_degrees(&self) -> (f64, f64, f64)
source§fn xyzt_to_degrees(&self) -> (f64, f64, f64, f64)
fn xyzt_to_degrees(&self) -> (f64, f64, f64, f64)
source§fn xy_to_arcsec(&self) -> (f64, f64)
fn xy_to_arcsec(&self) -> (f64, f64)
source§fn xyz_to_arcsec(&self) -> (f64, f64, f64)
fn xyz_to_arcsec(&self) -> (f64, f64, f64)
source§fn xyzt_to_arcsec(&self) -> (f64, f64, f64, f64)
fn xyzt_to_arcsec(&self) -> (f64, f64, f64, f64)
source§fn xy_to_radians(&self) -> (f64, f64)
fn xy_to_radians(&self) -> (f64, f64)
source§fn xyz_to_radians(&self) -> (f64, f64, f64)
fn xyz_to_radians(&self) -> (f64, f64, f64)
source§fn xyzt_to_radians(&self) -> (f64, f64, f64, f64)
fn xyzt_to_radians(&self) -> (f64, f64, f64, f64)
source§fn set_nth(&mut self, n: usize, value: f64)
fn set_nth(&mut self, n: usize, value: f64)
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)
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)
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)
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,
source§fn hypot3(&self, other: &Self) -> f64where
Self: Sized,
fn hypot3(&self, other: &Self) -> f64where
Self: Sized,
fn scale(&self, factor: f64) -> Self
fn dot(&self, other: Self) -> f64where
Self: Sized,
source§impl PartialEq for Coor2D
impl PartialEq for Coor2D
impl Copy for Coor2D
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 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