Search documentation of Localize

# Localize.Unit.Conversion.Beaufort (Localize v0.39.0)

Copy Markdown View Source

Nonlinear conversion between the Beaufort wind force scale and meters per second.

Implements the ICU algorithm using interpolated midpoints between the WMO-defined speed thresholds for each Beaufort number.

Registered as a `:special` custom unit so that the generic conversion pipeline dispatches through `forward/1` and `inverse/1` rather than using factor-based arithmetic.

## Summary

### Functions

forward(beaufort)

Converts a Beaufort scale value to meters per second.

inverse(mps)

Converts meters per second to a Beaufort scale value.

## Functions

# forward(beaufort)

    @spec forward(number()) :: float()

Converts a Beaufort scale value to meters per second.

Values are clamped to the range [0, 17]. Fractional Beaufort numbers are interpolated between adjacent midpoints.

# inverse(mps)

    @spec inverse(number()) :: float()

Converts meters per second to a Beaufort scale value.

Finds the Beaufort band whose midpoint range contains the given speed and interpolates within it.