Skip to main content

Module sailing

Module sailing 

Source
Expand description

Velocity made good and laylines.

Structs§

TackLegs
How far to sail on each tack to fetch a mark dead to windward.

Constants§

LAYLINE_LENGTH_FACTOR
How far past the mark a layline ray reaches from layline_rays, as a multiple of the vessel’s own current distance to the mark – long enough that the ray always extends past wherever the vessel actually is on the chart, short enough that it does not dominate a zoomed-in view. A fixed on-screen length cannot do this: it would either vanish at ocean scale or blot out a marina at pier scale. pub so every client draws the same length rather than picking its own.
TACK_RAY_LENGTH_NM
How far a tack ray reaches from the vessel in tack_rays.

Functions§

close_hauled_headings_deg
The two close-hauled headings for a given wind, degrees true.
layline_rays
The two laylines through mark, as ray endpoints from mark itself – (mark, starboard_end, port_end) – or None when mark does not need a beat at all.
tack_legs
Splits the distance to an upwind mark into one leg on each tack.
tack_rays
The vessel’s own two close-hauled headings right now, as ray endpoints from vessel itself – (starboard_end, port_end).
vmg_to_waypoint_kn
Speed made good directly towards a waypoint, knots.
vmg_to_wind_kn
Speed made good directly to windward, knots.