Skip to main content

heading_to_steer

Function heading_to_steer 

Source
pub fn heading_to_steer(
    desired_track_deg: f64,
    stw_kn: f64,
    current: Current,
) -> Option<SteerSolution>
Expand description

The heading to steer to make good desired_track_deg against a current, and the speed over ground it yields.

Returns None when no heading achieves it: either the cross-track component of the current exceeds the vessel’s speed through the water, or it can be cancelled but only while being pushed backwards along the track. Both mean the leg cannot be laid at this speed, which is a real answer and one the caller must show rather than round away.