From 1af99723b0d54ca5ef2e3e944edc75fc32bf7920 Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Wed, 11 Dec 2024 13:59:35 -0500 Subject: [PATCH] Fix Readme example Parentheses for ra and dec, import PI --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6bd6bcd..6e654dc 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Testing all constellations on the sky, all of them worked without any issues (st Below is an example of solving the [GeCAA 2020 Theory task 7](https://gecaa.ee/wp-content/uploads/2020/10/GeCAA-Theoretical-solutions.pdf) analytically. ```rust use spherical_geometry::{SphericalPoint, GreatCircle}; +use std::f32::consts::PI; fn gecaa_2020_theory_7() { let delta = 10e-2; @@ -60,10 +61,10 @@ fn gecaa_2020_theory_7() { let intersections = circle_1.intersect_great_circle(&circle_2).expect("The paths are not parallel"); - let [(ra_1, dec_1), (ra_2, dec_2)] = if intersections[0].ra < intersections[1].ra { - [(intersections[1].ra, intersections[1].dec), (intersections[0].ra, intersections[0].dec)] + let [(ra_1, dec_1), (ra_2, dec_2)] = if intersections[0].ra() < intersections[1].ra() { + [(intersections[1].ra(), intersections[1].dec()), (intersections[0].ra(), intersections[0].dec())] } else { - [(intersections[0].ra, intersections[0].dec), (intersections[1].ra, intersections[1].dec)] + [(intersections[0].ra(), intersections[0].dec()), (intersections[1].ra(), intersections[1].dec())] }; let (ra_1_corr, dec_1_corr) = ((360.0 - 21.94) * PI / 180.0, 13.96 * PI / 180.0); // Once again switch RA direction as the question measures azimuth from north to east @@ -105,4 +106,4 @@ State key: | Intersection with another arc | 🔴 | | **Polygons** | 🟢 | | Construction from vertices | 🟢 | -| Check if it contains a point | 🟢 | \ No newline at end of file +| Check if it contains a point | 🟢 |