Skip to content

nmeasim::core::physics

namespace nmeasim::core::physics · Library API

Physical models of the simulated environment, part of the nmeasim::core library.

It currently holds the wind triangle that turns the true wind into the apparent wind felt on board.

Types

Type Description
ApparentWind Apparent wind as experienced on board a moving vessel.

Summary

Functions

Name Description
apparent_wind() Combines the true wind with the vessel's motion through the water.

Functions

apparent_wind()

ApparentWind apparent_wind(
    double true_direction_deg,
    double true_speed_kn,
    double heading_true_deg,
    double speed_kn) noexcept

Combines the true wind with the vessel's motion through the water.

The apparent wind velocity is the true wind velocity minus the vessel's velocity. A vessel making way into a head wind feels a stronger wind from ahead; running before the wind it feels a weaker one from astern. When the apparent wind speed is below 1e-9 kn its direction is undefined, so the true wind direction is reported instead.

Parameters

Name Type Description
true_direction_deg double Direction the true wind blows from, in degrees true; any value, it is normalised.
true_speed_kn double True wind speed, not negative.
heading_true_deg double Heading of the bow in degrees true; the vessel is assumed to move along it, without leeway.
speed_kn double Speed of the vessel through the water.

Returns ApparentWind: The apparent wind speed, its direction and its angle relative to the bow.

Declared in src/core/include/nmeasim/core/physics/wind.hpp:42 · defined in src/core/src/physics/wind.cpp:22