ranking near finish line
Publié : 11 févr. 2020 20:58
When I was doing the ranking on LS, either for André's team races, or for the English Forum ranking, I used the following algorithm:
1) I chose a point 1000 nm away from the line at 90 degrees to it (orthodromic distance)
2) For each boat I calculated the distance D and bearing to this point, as well as distances to both the red and the green flags :
- If the bearing was less than the bearing to red flag, distance was the distance to the red flag
- if the bearing was greater than the bearing to the green flag, distance was the distance to the green flag
- if the bearing was between the two, the distance was (D - 1000) nm
One little trap was that when the bearing is greater than 360 it winds back to 0, so I made sure to add 360 if the bearings required it to ensure the order was correct.
In RG the problem is a bit more complicated because the line can be crossed from either side. In LS, those crossing by touch and go were a headache but it did not happen often... but we had a finish line once that was 120 nm long and this was the only way to get a sensible result
1) I chose a point 1000 nm away from the line at 90 degrees to it (orthodromic distance)
2) For each boat I calculated the distance D and bearing to this point, as well as distances to both the red and the green flags :
- If the bearing was less than the bearing to red flag, distance was the distance to the red flag
- if the bearing was greater than the bearing to the green flag, distance was the distance to the green flag
- if the bearing was between the two, the distance was (D - 1000) nm
One little trap was that when the bearing is greater than 360 it winds back to 0, so I made sure to add 360 if the bearings required it to ensure the order was correct.
In RG the problem is a bit more complicated because the line can be crossed from either side. In LS, those crossing by touch and go were a headache but it did not happen often... but we had a finish line once that was 120 nm long and this was the only way to get a sensible result