pub struct Ecef { /* private fields */ }Expand description
地心直交座標系(ECEF: Earth-Centered, Earth-Fixed)における座標を表す。
原点は地球の重心にあり、
- X 軸は赤道面上で本初子午線方向
- Y 軸は赤道面上で東経 90 度方向
- Z 軸は北極方向
単位はすべてメートル。
Implementations§
Source§impl Ecef
impl Ecef
Sourcepub fn set_x(&mut self, x: f64)
pub fn set_x(&mut self, x: f64)
X 成分を設定する。
§Examples
let mut ecef = Ecef::new(0.0, 0.0, 0.0);
ecef.set_x(5.0);
assert_eq!(ecef.x(), 5.0);Sourcepub fn set_y(&mut self, y: f64)
pub fn set_y(&mut self, y: f64)
Y 成分を設定する。
§Examples
let mut ecef = Ecef::new(0.0, 0.0, 0.0);
ecef.set_y(6.0);
assert_eq!(ecef.y(), 6.0);Sourcepub fn set_z(&mut self, z: f64)
pub fn set_z(&mut self, z: f64)
Z 成分を設定する。
§Examples
let mut ecef = Ecef::new(0.0, 0.0, 0.0);
ecef.set_z(7.0);
assert_eq!(ecef.z(), 7.0);Sourcepub fn single_id(&self, z: u8) -> Result<SingleId, Error>
pub fn single_id(&self, z: u8) -> Result<SingleId, Error>
この ECEF 座標を、指定されたズームレベルの SingleId に変換する。
Sourcepub fn range_id(&self, z: u8) -> Result<RangeId, Error>
pub fn range_id(&self, z: u8) -> Result<RangeId, Error>
この ECEF 座標を、指定されたズームレベルの RangeId に変換する。
pub fn norm_squared(&self) -> f64
Sourcepub fn eq_epsilon(&self, other: &Ecef, epsilon: f64) -> bool
pub fn eq_epsilon(&self, other: &Ecef, epsilon: f64) -> bool
Ecefが同じ位置にあるかを判定します 2点間の直線距離が epsilon 以内にあるかを判定します
Sourcepub fn get_component(&self, index: usize) -> f64
pub fn get_component(&self, index: usize) -> f64
指定された軸インデックス (0=x, 1=y, 2=z) の成分を返す。 投影計算などで軸を動的に扱いたい場合に有用。
Trait Implementations§
impl Copy for Ecef
Source§impl CoverSingleIds for Ecef
impl CoverSingleIds for Ecef
Source§impl<'de> Deserialize<'de> for Ecef
impl<'de> Deserialize<'de> for Ecef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Coordinate> for Ecef
impl From<Coordinate> for Ecef
Source§fn from(value: Coordinate) -> Self
fn from(value: Coordinate) -> Self
CoordinateをEcefへの変換。
let coord = Coordinate::new(43.068564, 41.3507138, 30.0).unwrap();
let ecef: Ecef = coord.into();
print!("{},{},{}", ecef.x(), ecef.y(), ecef.z());
assert_eq!(ecef.x(), 3503254.6369501497);
assert_eq!(ecef.y(), 3083182.6924748584);
assert_eq!(ecef.z(), 4333089.862951963);Source§impl PartialOrd for Ecef
impl PartialOrd for Ecef
impl Point for Ecef
impl StructuralPartialEq for Ecef
Auto Trait Implementations§
impl Freeze for Ecef
impl RefUnwindSafe for Ecef
impl Send for Ecef
impl Sync for Ecef
impl Unpin for Ecef
impl UnsafeUnpin for Ecef
impl UnwindSafe for Ecef
Blanket Implementations§
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