pub struct Coor32(pub [f32; 2]);
Expand description
Generic 2D Coordinate tuple, with no fixed interpretation of the elements.
A tiny coordinate type: Just one fourth the weight of a Coor4D
.
Probably only useful for small scale world maps, without too much zoom.
Tuple Fields§
§0: [f32; 2]
Implementations§
source§impl Coor32
impl Coor32
Constructors
sourcepub fn geo(latitude: f64, longitude: f64) -> Coor32
pub fn geo(latitude: f64, longitude: f64) -> Coor32
A Coor32
from latitude/longitude/height/time, with the angular input in degrees,
and height and time ignored.
sourcepub fn arcsec(longitude: f64, latitude: f64) -> Coor32
pub fn arcsec(longitude: f64, latitude: f64) -> Coor32
A Coor32
from longitude/latitude/height/time, with the angular input in seconds
of arc, and height and time ignored. Mostly for handling grid shift elements.
sourcepub fn gis(longitude: f64, latitude: f64) -> Coor32
pub fn gis(longitude: f64, latitude: f64) -> Coor32
A Coor32
from longitude/latitude/height/time, with the angular input in degrees,
and height and time ignored.
sourcepub fn raw(first: f64, second: f64) -> Coor32
pub fn raw(first: f64, second: f64) -> Coor32
A Coor32
from longitude/latitude/height/time, with the angular input in radians,
and height and time ignored.
sourcepub fn iso_dm(latitude: f64, longitude: f64) -> Coor32
pub fn iso_dm(latitude: f64, longitude: f64) -> Coor32
A Coor32
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) -> Coor32
pub fn iso_dms(latitude: f64, longitude: f64) -> Coor32
A Coor32
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 Coor32
impl CoordinateTuple for Coor32
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 Coor32
impl PartialEq for Coor32
impl Copy for Coor32
impl StructuralPartialEq for Coor32
Auto Trait Implementations§
impl Freeze for Coor32
impl RefUnwindSafe for Coor32
impl Send for Coor32
impl Sync for Coor32
impl Unpin for Coor32
impl UnwindSafe for Coor32
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