FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
marenv::calc::DepthInterval Struct Reference

#include <DepthAxis.h>

Public Member Functions

double Interpolate (const std::vector< double > &values) const
 values[upper] (1 - weight) + values[upper + 1] weight; values has one entry per layer of the axis.
 

Public Attributes

std::size_t upper
 Index of the shallower layer of the interval, 0 to Size() - 2.
 
double weight
 Weight of the deeper layer upper + 1, in [0, 1].
 
Status status
 OK inside the axis and at its layers; OUT_OF_RANGE_INACCURATE when clamped to the first or the last layer; ERROR_NOT_SET for a NaN depth.
 

Detailed Description

Where a depth lies on a DepthAxis: the bracketing layers and the linear weight between them.

A value tabulated at the layers interpolates as values[upper] (1 - weight) + values[upper + 1] weight (Interpolate()). Clamped above the first layer the interval is the first one with weight 0, clamped below the last layer the last one with weight 1, so the value is that of the nearest layer.


The documentation for this struct was generated from the following file: