-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
766915d
commit 36c00d9
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use geographiclib_rs::{DirectGeodesic, Geodesic}; | ||
fn main() { | ||
let g = Geodesic::wgs84(); | ||
let jfk_lat = 40.64; | ||
let jfk_lon = -73.78; | ||
let northeast_azimuth = 45.0; | ||
|
||
let (lat, lon, az) = g.direct(jfk_lat, jfk_lon, northeast_azimuth, 10e6); | ||
|
||
use approx::assert_relative_eq; | ||
assert_relative_eq!(lat, 32.621100463725796); | ||
assert_relative_eq!(lon, 49.05248709295982, epsilon = 1e-13); | ||
assert_relative_eq!(az, 140.4059858768007); | ||
|
||
println!("lat: {lat}, lon: {lon}, az: {az}"); | ||
} |