kinavis-colregs
COLREGs steering and sailing rules (International Regulations for Preventing Collisions at Sea, 1972) for the KINAVIS crates.
For two vessels — positions, motion, categories — returns the encounter type
(overtaking, head-on, crossing), which vessel gives way under which rule, and
the permitted manoeuvre: Rules 12–19 as data, Rule 19 in restricted visibility.
CPA/TCPA kinematics are in kinavis-traffic; the two are used together.
Sector widths are conventions and are configurable in ColregsConfig. Rules 9
and 10 (narrow channels, TSS) are not applied. Every ruling names its deciding
rule.
use ;
use ;
use ;
// Own ship heading north; power-driven target on the starboard bow heading west.
let own = new;
let target = new;
let contact = Contact ;
let ruling = rule_of_the_road?;
assert_eq!;
assert_eq!;
# Ok::
Feature flags
std(default) — standard library maths in the kernel.libm— forno_stdtargets:--no-default-features --features libm.serde— serialisation of the value types.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.