metconv2zmcomp: Convert meteorological wind speed and direction to u/v...

View source: R/utils.R

metconv2zmcompR Documentation

Convert meteorological wind speed and direction to u/v components

Description

Converts wind speed (magnitude) and direction (in degrees, meteorological convention: direction from which the wind blows, measured clockwise from north) into zonal (u) and meridional (v) components.

Usage

metconv2zmcomp(speed, direction, names = c("uwnd", "vwnd"))

Arguments

speed

Numeric vector of wind speeds.

direction

Numeric vector of wind directions in degrees (0° = from north, 90° = from east, 180° = from south, 270° = from west).

names

(optional) ames to construct the resulting data.frame.

Value

A data.frame with two columns:

u

Zonal wind component (m/s), positive eastward.

v

Meridional wind component (m/s), positive northward.

Examples

# Example 1: North wind of 10 m/s (blowing southward)
metconv2zmcomp(10, 0)

# Example 2: East wind of 5 m/s (blowing westward)
metconv2zmcomp(5, 90)

# Example 3: South wind of 8 m/s (blowing northward)
metconv2zmcomp(8, 180)


resourcecode documentation built on Nov. 10, 2025, 5:06 p.m.