Skip to content

Commit

Permalink
neo
Browse files Browse the repository at this point in the history
  • Loading branch information
p4ken committed Jul 4, 2024
1 parent 7fbfa3d commit fbe370d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub mod neo11;
pub mod neo12;
pub mod neo12a;
pub mod neo13;
pub mod neo14;
pub mod neo2;
pub mod neo5;
pub mod neo5a;
Expand Down
48 changes: 48 additions & 0 deletions src/neo14.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#![allow(unused)]

pub mod jgd {
pub struct Tokyo;
impl Tokyo {
pub fn new(degrees: LatLon) -> Self {
todo!()
}
pub fn to_jgd2000(&self) -> Jgd2000 {
todo!()
}
}

pub struct Jgd2000;
impl Jgd2000 {
pub fn degrees(&self) -> LatLon {
todo!()
}
}

pub struct LatLon(pub f64, pub f64);
impl LatLon {
pub fn as_array(&self) -> [f64; 2] {
todo!()
}
}
impl From<[f64; 2]> for LatLon {
fn from(value: [f64; 2]) -> Self {
todo!()
}
}
}

#[cfg(test)]
pub fn usage() {
use jgd::{LatLon, Tokyo};

let LatLon(lat, lon) = Tokyo::new(LatLon(1., 2.)).to_jgd2000().degrees();

// もうちょっと
let (x, y) = (2, 1);
let yx = [y, x].map(|x| f64::from(x) * 3_600_000.);
let yx = Tokyo::new(yx.into())
.to_jgd2000()
.degrees()
.as_array()
.map(|x| (x / 3_600_000.).floor() as i32);
}

0 comments on commit fbe370d

Please sign in to comment.