Skip to content

Commit

Permalink
Merge pull request #5 from hombit/patch-1
Browse files Browse the repository at this point in the history
Fix Readme example
  • Loading branch information
Pandicon authored Dec 14, 2024
2 parents 601c897 + 1af9972 commit 2cb1e04
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -105,4 +106,4 @@ State key:
| Intersection with another arc | 🔴 |
| **Polygons** | 🟢 |
| Construction from vertices | 🟢 |
| Check if it contains a point | 🟢 |
| Check if it contains a point | 🟢 |

0 comments on commit 2cb1e04

Please sign in to comment.