Loading...
Searching...
No Matches
wind_dir.h File Reference

The compass direction a wind is blowing from, as a bearing and as a sideways component. More...

Go to the source code of this file.

Functions

int wind_bearing (const char *dir)
 The bearing a 16-point compass abbreviation stands for.
int wind_lean (int bearing)
 The east-west component of a wind, as a signed proportion.

Detailed Description

The compass direction a wind is blowing from, as a bearing and as a sideways component.

The wire carries a 16-point abbreviation like "NW" or "SSE". That is fine to print and no use for arithmetic, so this turns it into degrees, and degrees into the part of the wind that runs across a view seen from the side.

Pure arithmetic on a string, so there is no watch behind it. Reading the store is the caller's job. An unknown or empty direction answers "no data" rather than guessing north.

See units/wind.h for the other half of a wind reading, which converts its speed.