Skip to content

Commit ebcc096

Browse files
authored
Create main.rs
1 parent 1f403fd commit ebcc096

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

rust_magnetic/src/main.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use time::OffsetDateTime;
2+
use wmm::declination;
3+
4+
fn main() {
5+
let date = OffsetDateTime::now_utc().date();
6+
let lat = 29.7363025;
7+
let lon = -93.8827939;
8+
let dec = declination(date, lat, lon).unwrap();
9+
10+
println!(
11+
"Today's declination for coordinates {},{} is {}°",
12+
lat, lon, dec
13+
)
14+
}

0 commit comments

Comments
 (0)