pub fn tack_legs(
bearing_to_mark_deg: f64,
distance_to_mark_nm: f64,
true_wind_direction_deg: f64,
beat_angle_deg: f64,
) -> Option<TackLegs>Expand description
Splits the distance to an upwind mark into one leg on each tack.
beat_angle_deg is the angle the boat sails off the true wind when
close hauled – a polar property of the boat, typically 35-50 degrees,
which is why it is a parameter and not a constant.
Returns None when the mark does not need two tacks: it is already
fetchable on one, or it is not upwind at all. That is the signal to stop
drawing laylines, not an error.
§Model
Plane trigonometry on the triangle formed by the two headings and the bearing to the mark, deliberately: laylines are a tactical picture over a few miles, where the difference against a spherical solution is far below the accuracy of the beat angle it is built on. Do not reach for this over ocean distances.