Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Readme example #5

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | 🟢 |
Loading